Want to show data in group using group by
I have a table where there is composite key of id
and emp_no
.
I want to show record of all tid
s against one emp_no
like this (not using any aggregate function开发者_开发百科s because no need to show any thing like that):
emp_no tid
tid
tid
emp_no2 tid
tid
tid
Thanks in advance
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
精彩评论