开发者

Want to show data in group using group by

开发者 https://www.devze.com 2023-01-22 08:03 出处:网络
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

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

精彩评论

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