order_by vs group_by
what's diference /g/ ?
>>58404061
Read your textbook
They aren't similar in the first place OP
>>58404087
>>58404099
can't u just help me ?
i'm not asking much
>>58404061
>>58404212
order_by orders your data
group_by groups your data
>>58404061
One groups results of aggregate functions by column, the other orders results in ascending or descending order of a certain column. In future: http://www.w3schools.com/sql/
Now delete your shitty thread
Order by is ordering the results, ex from high to low on ID
group by is grouping the resultset meaning everything with ex. ID 5 will be lumped together
>>58404061
>>58404227
>>58404242
>>58404268
thx for help
Fuck off pajeet
>>58404061
One changes the order, one groups together for use with aggregate functions.
Protip: NEVER project fields besides the one(s) you're grouping by without aggregate functions. In reasonable SQL implementations this will cause an error, in MySQL this will just do who knows what.
Is this the learn programming reddit?