Since I am coming from MSSQL world I am confused, what happening in queries where you have group by clause and other columns in select which do not go through aggregates functions.
I was shocked when MySql executed query like this
select * from myTable group by columnThatIsNotPk
Or fiddle like this http://sqlfiddle.com/#!9/b30bf5/1
My questions are:
- Is there an explanation which data I am going to get for columns that not exists in group by clause?
- Is it ok to use queries like that?
- Do I lose or gain performances with queries like this?
- Does MySql implements First and Last aggregates as it does JetEngine in ACCESS, and unfortunately missing feature in MSSQL engine?