问题
For example:
Select max(date)
From table A
Where max(date) < any (select..
...)
Group By Book_Name,Client_Name
So the max(date)
field could be compared to the Nestled Select
return, as if the grouping of the greater Select was already made.
回答1:
What you want is typically done with the HAVING
clause.
Select Book_Name,Client_Name, max(date)
From table A
Group By Book_Name,Client_Name
HAVING max(date) < any (select..
...)
I removed reference to the other answer. I don't think it was correct and doesn't really help because I think HAVING is what you need.
来源:https://stackoverflow.com/questions/30147349/sql-can-i-have-a-group-by-clause-after-a-nestled-select