Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Informer30
Starting Member

26 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
52326 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

26 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
52326 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  
 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.05 seconds. Powered By: Snitz Forums 2000