What is wrong with this group by sql Query?


#1

What is wrong with this group by sql Query?
​select * from empjoin group by sex

[It is a question from a learner]


#2

​This is invalid:
​select * from empjoin group by sex

​While this is valid:
​select sec, count() from empjoin group by sex*

Why?
​If there is a group by, the only columns that can exist in select statements are either the column on which group by is done.​