Verify your knowledge
- Consider these two queries:
- select category,count(*) from posts group by category order by category;
- select category, count(*) over (partition by category) from posts order by category;
Which of the two queries has a greater number of records?
The second query has a greater number of records.
See the Using basic statement window functions section for more details.
- Consider these two queries:
- select category,count(*) from posts group by category order by category;
- select distinct category, count(*) over (partition by category) from posts order by category;
Which of the 2 queries has a greater number of records?
The two queries have the same number of records.
See the Using basic statement window functions section for more details.
- Which of these two queries is semantically correct?
- select category...