• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to output top 5 from two different dates in the same column?

Resolved: How to output top 5 from two different dates in the same column?

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I’m trying to find the best 5 students from 2016 and 2017. My query right now looks like this:
and the output looks like this:
picture of my output
What is a possible way to have the top 5 from 2016 and 2017 in the same column?

Answer:

This should return you the top 5 for both years
If you want to order by some other columns just change the column name.
Also the group by is unnecessary as you don’t need the max() aggregate function.
Edit: Found on this post that you should add parenthesis

If you have better answer, please add a comment about this, thank you!

mysql sql
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Java Swing center JLabel in JPanel with two JLabels

27/03/2023

Resolved: How to compare two text files and and change the sign of the data in powershell?

27/03/2023

Resolved: Java Virtual Machines deleted

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.