All Forums General
Purushotham 87 posts Joined 04/14
05 Jul 2014
I have a country table with country_name column.

Hi Everyone,
Eg:   country_name
         India
         Australia
         srilanka
         America
         London
 
In this , but i need India as First,remaining countries will be based on desc order,how can we achieve this?
 
Regards,
Purushotham
         
 

Purushotham.M
dnoeth 4628 posts Joined 11/04
05 Jul 2014

Hi Purushotham,
you need a CASE:

order by
   case when country_name = 'India' then 0 else 1 end,
   country_name desc

 

Dieter

Purushotham 87 posts Joined 04/14
05 Jul 2014

Hi dnoeth,

I got the result,thank you..

I noticed in the forums,whatever scenaries people are asking,you are giving perfect answers especially SQL logic and teradata concepts.

Really I appreciate a lot,once again thank u so much dnoeth.

Thanks,
Purushotham.

Purushotham.M

You must sign in to leave a comment.