List:General Discussion« Previous MessageNext Message »
From:Harald Fuchs Date:December 10 2002 5:51pm
Subject:Re: Select and Sort?
View as plain text  
In article <3DF5C2AD.4090706@stripped>,
Tariq Murtaza <tariq@stripped> writes:

> Hi All,
> I am wondering how to do that.....
> Suppose we have data like this below

> ID	Category
> -------------------------
> 1	Software Engg	
> 2	Engg
> 62	Commerce
> 87	Ecommerce
> 45	physics
> 95	chemistry
> 6	biochemistry
> 7	math
> 5	Others

> I want to achieve recordset like below (sorting category by Name and 
> including 'Others' at the end),
> I want to do that by single query ;), any idea???


> ID	Category
> ------------------------
> 6	biochemistry
> 62	Commerce
> 95	chemistry
> 2	Engg
> 87	Ecommerce
> 7	math
> 45	physics
> 1	Software Engg	
> 5	Others

> Looking forward,
> Tariq

SELECT id, name
FROM mytable
ORDER BY name = "Others", name;
Thread
Select and Sort?Tariq Murtaza10 Dec
  • Re: Select and Sort?Fred van Engen10 Dec
  • Re: Select and Sort?Tariq Murtaza10 Dec
    • Re: Select and Sort?Fred van Engen10 Dec
    • RE: Select and Sort?Adolfo Bello10 Dec
  • Re: Select and Sort?Harald Fuchs10 Dec
  • Re: Select and Sort?Harald Fuchs10 Dec