mysql - PHP echo out id with the same value -
i have table

what want query/echo out id same value example id 1 , id 3 has same value. possible in same table , column? thanks!
you can use self-join pairs of ids same weight
select t1.weight, t1.id id1, t2.id id2 yourtable t1 join yourtable t2 on t1.weight = t2.weight , t1.id < t2.id or group_concat ids same weight in single row:
select weight, group_concat(id) ids yourtable group weight having count(*) > 1 to 1 pair each weight:
select t1.weight, t1.id id1, t2.id id2 yourtable t1 join yourtable t2 on t1.weight = t2.weight , t1.id < t2.id group t1.weight
Comments
Post a Comment