I have a table similar to thisorganisatio n | idXYZ | 1ABC | 2ATC | 3GAC | 4ATA | 5CAT | 6ARE | 7ATE | 8
When I run this query, select organisation from table
It produces the output as it is, the order also same as of tableHowever, when I run this query select organisation from table group by organisation
Though it produces all rows as in the table, it shuffles rows. The order is not same as of table.I wonder what causes it to shuffle rows after I add group by clause. Is there any logic behind this in SQL Server?