nested query problem

Поиск
Список
Период
Сортировка
От David Gauthier
Тема nested query problem
Дата
Msg-id CAMBRECCCSqSRZnBz2--ShfaP9fhkJYMVu+zktj6CEuZuT6Ovww@mail.gmail.com
обсуждение исходный текст
Ответы Re: nested query problem
Re: nested query problem
Список pgsql-general
Hi:

I'm having trouble with this query...

select sr.sqf_id, sr.status, fse.perl_sub_name, fse.end_datetime
  from 
    sqf_runs sr,
    (select perl_sub_name, end_datetime from flow_step_events_view where sqf_id = sr.sqf_id order by 2 limit 1) fse
  where sr.userid='foo';

ERROR:  invalid reference to FROM-clause entry for table "sr"
LINE 4: ...atetime from flow_step_events_view where sqf_id = sr.sqf_id ...
                                                             ^
HINT:  There is an entry for table "sr", but it cannot be referenced from this part of the query.


If this is indeed a foul, how can I accomplish the same thing ?

Thanks in Advance !

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: timestamp arithmetics in C function
Следующее
От: Paul Jungwirth
Дата:
Сообщение: Re: nested query problem