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>
Re: Help writing a piece of SQL Niklas Johansson <spot@tele2.se>

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
Дата:
От: Philly Mandiza
Дата:
Сообщение: UnixODBC-2.2.8-2.3.0 driver
FAQ