Re: Select and Sort?

2002-12-10 Thread Fred van Engen
On Tue, Dec 10, 2002 at 03:32:13PM +0500, Tariq Murtaza wrote: 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??? IDCategory 6 biochemistry 62

Re: Select and Sort?

2002-12-10 Thread Tariq Murtaza
Thanks for help. here is another solution for that... SELECT if (Category = 'others', '999', 0) as priority, ID, Category FROM TableName ORDER BY priority, Category Tariq Fred van Engen wrote: On Tue, Dec 10, 2002 at 03:32:13PM +0500, Tariq Murtaza wrote: I want to achieve recordset like

Re: Select and Sort?

2002-12-10 Thread Fred van Engen
On Tue, Dec 10, 2002 at 04:12:22PM +0500, Tariq Murtaza wrote: Thanks for help. here is another solution for that... SELECT if (Category = 'others', '999', 0) as priority, ID, Category FROM TableName ORDER BY priority, Category That's right. It has the same problem regarding

RE: Select and Sort?

2002-12-10 Thread Adolfo Bello
SELECT ... WHERE Category 'others' UNION SELECT ... WHERE Category='others' -Original Message- From: Tariq Murtaza [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 7:12 AM To: Fred van Engen Cc: [EMAIL PROTECTED] Subject: Re: Select and Sort? Thanks for help