0
這可能是一個簡單的語法錯誤,但我一直在看它一個小時,我只是無法找到它,也許另一組眼睛可以幫助指向我在正確的方向?SQL Server 2012,嵌套select語句,語法錯誤?我沒有看到它
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.
AKA,別名派生表,就像邁克爾說的那樣。 – Jace
查詢的外部部分期望將其稱爲'ba' – Laurence
在外部查詢中,我將'ba.isbn'更改爲'q.isbn',以避免混淆。 –