What is wrong with this group by sql Query?

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

[It is a question from a learner]

​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.​