English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

what is the differnce between group by and order by in sql server query wih example explaination?

2006-07-09 18:46:44 · 2 answers · asked by saravanan 1 in Computers & Internet Programming & Design

2 answers

example: select id group by id order by id

GROUP BY - you use this so that no duplicate will exist in IDs.
ORDER BY - means you sorted your id.

So that if you have data like F002, F003,F004,F002,F003,F004...

What returned from your query (from above sample) was: F002,F003,F004

2006-07-09 22:07:02 · answer #1 · answered by VBACCESSpert 5 · 1 0

Here below is some resource that maybe helpful for your qs.

2006-07-09 19:11:21 · answer #2 · answered by pKt 1 · 0 0

fedest.com, questions and answers