views:

37

answers:

1

I have a table where there is composite key of id and emp_no.

I want to show record of all tids against one emp_no like this (not using any aggregate functions because no need to show any thing like that):

emp_no   tid
         tid
         tid
emp_no2  tid
         tid
         tid

Thanks in advance

+1  A: 
SELECT * FROM `table` WHERE CONCAT(id,', ',emp_no) = 'id, emp_no'

In the above example 'id, emp_no' would be '1, 1' or any combination of id and emp_no.

Where does tid come from by the way you only mention emp_no and id

Michael Eakins