We help IT Professionals succeed at work.
Get Started

number of reference  mysql  write sql in my sql to get the rank

teera
teera asked
on
310 Views
Last Modified: 2021-04-21
the table below show  
 nae is ahead of  michale , cheery, victoria
susan is ahead of nae
david is ahead of susan



id      robert      headid
1      david      
2      nae              4
3      michale      2
4      susan      1
5      cheery      2
6      victoria      2
7      michele      2
8      nicole      3
9      taylor      2
10      rossom      2


how can I write the code in sql to show

name   rank
david    3
susan   2
nae       1

etc  

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE