Created
September 13, 2022 07:46
-
-
Save saqibmehmoodgit/699f1971d56e6d5aa370aa9533e99866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table student | |
bookid authorid | |
1 1 | |
1 2 | |
2 2 | |
select s.bookid from student s | |
group by s.bookid | |
having count(s.authorid) =1 | |
Explaination :::: As we know that "group by" is executed before "having" so first line number 8 will be executed | |
and there will be 2 groups (1 and 2) and than having will be executed so how the answer will be 2 only . | |
Can any body tell that if there is having after group by so they will be executed same time ? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment