这可能是一个简单的语法错误,但我已经看了一个小时,我就是找不到它,也许另一双眼睛可以帮助我指出正确的方向??
select
lname +', '+ Fname as "Author Name"
from
Author a
join
BOOKAUTHOR ba on a.AuthorID = ba.authorid
where
ba.isbn = (select ba.isbn
from
(select
ROW_NUMBER() over (order by sum(quantity) desc) as "Placement",
b.isbn,
sum(QUANTITY) as "Total"
from
ORDERITEMS oi
join
Books b on b.ISBN = oi.isbn
group by
b.ISBN)
where Placement = 1) --the "WHERE" is giving me an error.