suppose this is table name user with content follwing
id name m_id
1 A Null
2 B 1
3 C 1
4 D 2
write select query for output should be
2 B A
3 C A
4 D B
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
self join, SELECT t1.id,t1.name,t2.name FROM myTable t1 JOIN myTable t2 ON t1.id=t2.m_id
20 People are following this question.
I have a email database
MySQL query performance
Sql Select Query Row number not giving desired Results
How to find the category that is both ordered & clicked by customer joining multiple tables?
Can I query data as of a point in time?