SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Grouping order in SQL 2008
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Informer30
Starting Member

23 Posts

Posted - 11/29/2011 :  16:56:00  Show Profile  Reply with Quote
Hi All,

I have a basic select statement and I wanted to know is it possible in sql 2008 to order the group by e.g

select field_a, field_b, field_c, field_d
from table_1
where field_a = 'Student'
Group by field_a (Group1),
field_c (Group2),
field_d (Group3),
field_b(Group4)

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 11/30/2011 :  01:35:25  Show Profile  Reply with Quote
you can
add order by for that
iie,
order by field_a ,
field_c ,
field_d ,
field_b



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Informer30
Starting Member

23 Posts

Posted - 11/30/2011 :  04:00:52  Show Profile  Reply with Quote
Thanks, that worked...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 11/30/2011 :  10:46:12  Show Profile  Reply with Quote
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000