Please support our ASP advertiser: Lunarpages ASP Web Hosting
![]() |
Hi there,
wanna ask if the sql syntax order by and group by the same?
eg: i have a dropdownlist and the values displayed should be in ascending order. hence is there any difference if i use these 2 sql statements below.
i've tested it out and it works well. was curious to know if there is any explaination/meaning behind the scene.
Though i know it may be peanut to you guys..but Thanks Alot!
wanna ask if the sql syntax order by and group by the same?
eg: i have a dropdownlist and the values displayed should be in ascending order. hence is there any difference if i use these 2 sql statements below.
sql1 = "select distinct * from t_staff group by staff" sql2 = "select distinct * from t_staff order by staff"
i've tested it out and it works well. was curious to know if there is any explaination/meaning behind the scene.
Though i know it may be peanut to you guys..but Thanks Alot!
cheers,
ohgosh
ohgosh
•
•
•
•
Originally Posted by amitlokare
Hi,
Ya there is difference in order by and group by
When u fire group by query its aggregate similar entries and show u single entriy for tht
but in order by u order list in alphabeticaly order
wad u mean by aggregrate similar entries? do u mean pick up oli distinct records? do it mean different if i remove distinct from select statement?
but i can still display my dropdownlist value in alphabeticaly order if i use group by..
is there anywhere to order the list in alphabeticaly order besides using order by?
cheers,
ohgosh
ohgosh
•
•
Join Date: Mar 2005
Location: LTT, South Africa
Posts: 125
Reputation:
Rep Power: 4
Solved Threads: 1
![]() |
Similar Threads
Other Threads in the ASP Forum
- is order by and group by the same? (MySQL)
- One-way(inbound)links offer (Search Engine Optimization)
- A new Enterprise Architecture online user group (IT Professionals' Lounge)
Other Threads in the ASP Forum
- Previous Thread: search record using search button from database
- Next Thread: InetCtls.Inet control problem
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode