order by instead of two queries

Bob Kline bkline at rksystems.com
Tue Mar 27 23:34:20 CEST 2001

On Tue, 27 Mar 2001, Leonardo B Lopes wrote:

> I have some data in a table that I would like to obtain order by a
> specific instance of the data. ex:
> Name:		Age:
> Joe		50
> Jill		60
> Jack		65
> What I would like to do is have a query that returns Jack first, then
> the regular name order. Something like:
> SELECT Name FROM clients ORDER BY Name='Jack',Name
> Can this be done with one query?

This can be done in standard SQL (using a CASE operation) but this is a
Python mailing list, not a SQL list.

Bob Kline
mailto:bkline at rksystems.com

More information about the Python-list mailing list