Re: Trying to execute several queries involving temp tables in a PHP script
От
Alexander Farber
Тема
Re: Trying to execute several queries involving temp tables
in a PHP script
Дата
Msg-id
CAADeyWhZbtLCrFXqLzRBGnMX+VH8Pj1WAyKQw14EZHNNFaO1bg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Trying to execute several queries involving temp tables in a PHP script Alexander Farber <alexander.farber@gmail.com>
Re: Trying to execute several queries involving temp tables in a PHP script Leif Biberg Kristensen <leif@solumslekt.org>
Re: Trying to execute several queries involving temp tables
in a PHP script Misa Simic <misa.simic@gmail.com>
Re: Trying to execute several queries involving temp tables
in a PHP script Alban Hertroys <haramrae@gmail.com>
Re: Trying to execute several queries involving temp tables
in a PHP script Misa Simic <misa.simic@gmail.com>
Re: Trying to execute several queries involving temp tables
in a PHP script Alexander Farber <alexander.farber@gmail.com>
Thank you Misa, the without-temp-tables query has worked flawlessly. On Wed, Jun 13, 2012 at 5:01 PM, Misa Simic wrote: > I think you can have all in one query, without temp tables: > > SELECT r.rid, r.cards, to_char(r.stamp, 'DD.MM.YYYY > HH24:MI') as day, > c.bid, c.trix, c.pos, c.money, c.last_ip, c.quit, > u.id, u.first_name, u.avatar, u.female, u.city, > u.vip > CURRENT_DATE as vip > FROM pref_rounds r, pref_cards c, pref_users u > WHERE u.id = c.id and > r.rid = c.rid and > r.rid in ( > > select rid > from pref_cards > where stamp > now() - interval '1 day' and > id in ( > select id > from pref_money > where yw = to_char(current_timestamp - interval '1 > week', 'IYYY-IW') > order by money > desc limit 10 > > ) and > bid = 'Misere' and > trix > 0 > > > ) > order by rid, pos;
В списке pgsql-general по дате отправления