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
how to get the difference between two aliases
SQL query using aggregate
How do I write this query?
MYSQL query result with schema