I have a query I wrote in Oracle but I can not seem to get it to work in MS SQL 2005.
I need to get the name of the author with the most orders.
The query below gives me the name and the max count, but I only want to see the name. That is where I am hung up.
Thanks,
GJ
I need to get the name of the author with the most orders.
The query below gives me the name and the max count, but I only want to see the name. That is where I am hung up.
Code:
(Select fname, Max(TotalB) as Total2
From
Select a2.fname, count(*) as TotalB
from author a2 join bookauthor ba
on a2.authorid = ba.authorid join books b
on ba.isbn = b.isbn join orderitems oi
on b.isbn = oi.isbn
Group by a2.fname)Tbl
Group By fname)
Thanks,
GJ