+ 3

Why isn't it working

Why does the query with GROUP BY not work and three values are returned? Can anyone help me? https://sololearn.com/compiler-playground/c1qiew47g99e/?ref=app

17th Oct 2024, 6:06 AM
Jakob
Jakob - avatar
3 Antworten
+ 2
You have an extra space in your data. I changed your query to include the field you are grouping on. That gave me this result: ('Baleen whale', 22.5) ('Baleen whale', 16.0) ('Dental whale', 2.1)
17th Oct 2024, 1:29 PM
Jerry Hobby
Jerry Hobby - avatar
+ 3
In aggregate values surely it will print a single value but here you have given in a group by subordination text where in 2 types of subordination values you had given while inserting into the table that is the reason it should print 2 values but I am unsure why it is printing 3 values.
17th Oct 2024, 8:53 AM
Aysha
Aysha - avatar
+ 1
Thank you very much👍
17th Oct 2024, 4:40 PM
Jakob
Jakob - avatar