Query question
От | Björn Metzdorf |
---|---|
Тема | Query question |
Дата | |
Msg-id | 033001c296e6$58be5bb0$81c206d4@office.turtleentertainment.de обсуждение исходный текст |
Ответы |
Re: Query question
|
Список | pgsql-general |
Hi, I've got a query which I'd like to optimize (for using indizes): This is a working version, but it does not do exactly what I want: ------ snip ------- SELECT m.* FROM table1 m, table2 ms, table3 s, table4 l, table5 c WHERE m.id = 262451 AND ms.value2 = m.id AND l.id = m.value AND s.id = ms.slot AND c.id = s.contestant ORDER BY m.date ASC ------ snap ------- This version should theoretically do what I want, but it does not work (it gives "ERROR: Relation "s" does not exist"): ------ snip ------- SELECT m.* FROM table1 m, table2 ms, table3 s, table4 l LEFT JOIN table5 c ON s.id = ms.slot WHERE m.id = 262451 AND ms.value2 = m.id AND l.id = m.value AND c.id = s.contestant ORDER BY m.date ASC ------ snap ------- Thanks for your help. Regards, Bjoern
В списке pgsql-general по дате отправления: