Re: SQL Newbie
| От | Owen Jacobson |
|---|---|
| Тема | Re: SQL Newbie |
| Дата | |
| Msg-id | 001601c59f68$6b2fff50$9b00015a@osl.com обсуждение исходный текст |
| Ответ на | Re: SQL Newbie ("Nick Stone" <nick@harelane.com>) |
| Список | pgsql-sql |
Nick Stone wrote: > Hope this helps > > SELECT > * > FROM > speed_history as outside etc.. > WHERE > (speed = ( > SELECT > speed > FROM > speed_history as inside etc.. > WHERE > (outside.interface = inside.interface) > LIMIT 1 > ORDER BY > speed DESC > ) > ) Worth noting that ORDER BY speed DESC LIMIT 1 is fundamentally the same as MAX (speed), except that MAX (speed) doesn't take advantage of any index present. This is a fairly common idiom but a self-described SQL Newbie may not see the equivalence instantly. -Owen
В списке pgsql-sql по дате отправления: