Re: Help writing a piece of SQL

Поиск
Список
Период
Сортировка
От Niklas Johansson
Тема Re: Help writing a piece of SQL
Дата
Msg-id 3F3A99C3-2368-4DD2-9396-2A2C23B14CF1@tele2.se
обсуждение исходный текст
Ответ на Re: Help writing a piece of SQL  ("Nigel Bishop" <Nigel.Bishop@ioko.com>)
Список pgsql-sql
On 3 feb 2006, at 14.06, Nigel Bishop wrote:

> Thank you very much, that did the business


This should generate the same plan as the previous query, but be a  
little bit more clean and easy to read:

SELECT sendto FROM users t1
WHERE domain='rusty.com' AND
username = COALESCE((SELECT username FROM users WHERE username='fred'  
and domain=t1.domain), username);



Sincerely,

Niklas Johansson





В списке pgsql-sql по дате отправления:

Предыдущее
От: "Nigel Bishop"
Дата:
Сообщение: Re: Help writing a piece of SQL
Следующее
От: Philly Mandiza
Дата:
Сообщение: UnixODBC-2.2.8-2.3.0 driver