开发者

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 tids 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜