Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 26, 2013 03:06 AM by sandeepmittal11
Member
474 Points
157 Posts
Jan 23, 2013 05:05 AM|LINK
Hi Mate,
Query get execute but not getting the output :-(
Please try it your self.
208 Points
81 Posts
Jan 23, 2013 05:11 AM|LINK
phineas Hi Mate, Query get execute but not getting the output :-( Please try it your self.
Are you try my way?
rsrvs123 select cty from TableName group by cty order by max(cty) ASC
select cty from TableName group by cty order by max(cty) ASC
All-Star
35898 Points
7333 Posts
Jan 23, 2013 06:39 AM|LINK
SELECT Cty FROM Car_mgnt Group by Cty
Contributor
2531 Points
513 Posts
Jan 25, 2013 08:43 AM|LINK
what version of sql server do you have?
6953 Points
1080 Posts
Jan 26, 2013 03:06 AM|LINK
Optiion 1 : Using subquery as suggested by me_ritz
SELECT Cty FROM ( SELECT DISTINCT Cty FROM Car_mgnt ) AS x ORDER BY Cty
Option 2 : Using "group by"
SELECT distinct Cty FROM Car_mgnt group by Cty order by Cty
phineas
Member
474 Points
157 Posts
Re: order By with distinct
Jan 23, 2013 05:05 AM|LINK
Hi Mate,
Query get execute but not getting the output :-(
Please try it your self.
rsrvs214
Member
208 Points
81 Posts
Re: order By with distinct
Jan 23, 2013 05:11 AM|LINK
Are you try my way?
oned_gk
All-Star
35898 Points
7333 Posts
Re: order By with distinct
Jan 23, 2013 06:39 AM|LINK
Suwandi - Non Graduate Programmer
goel.ankit
Contributor
2531 Points
513 Posts
Re: order By with distinct
Jan 25, 2013 08:43 AM|LINK
what version of sql server do you have?
Ankit
(Please select 'Mark as Answer' if my response has helped you.)
sandeepmitta...
Contributor
6953 Points
1080 Posts
Re: order By with distinct
Jan 26, 2013 03:06 AM|LINK
Optiion 1 : Using subquery as suggested by me_ritz
Option 2 : Using "group by"
Sandeep Mittal | My Blog - IT Developer Zone