correlated subquery

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема correlated subquery
Дата
Msg-id 199912292236.RAA13960@candle.pha.pa.us
обсуждение исходный текст
Ответы Re: [HACKERS] correlated subquery  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] correlated subquery  (sszabo@bigpanda.com)
Список pgsql-hackers
Is this a good example of a required correlated subquery:
SELECT f1.firstname, f1.lastname, f1.ageFROM friends f1WHERE age = (             SELECT MAX(age)             FROM
friendsf2             WHERE f1.state = f2.state            )ORDER BY firstname, lastname
 

It finds the oldest person in each state.  HAVING can't do that, right?

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] Index corruption
Следующее
От: Adriaan Joubert
Дата:
Сообщение: Re: [HACKERS] Index corruption