Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Re: Extract interdependent info from one table

Поиск
Список
Период
Сортировка
От Andrej Ricnik-Bay
Тема Re: Extract interdependent info from one table
Дата
Msg-id b35603930801251505t42f014aap8ae2b3d89bfe521f@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Extract interdependent info from one table  ("Phillip Smith" <phillip.smith@weatherbeeta.com.au>)
Список pgsql-sql
On 25/01/2008, Phillip Smith <phillip.smith@weatherbeeta.com.au> wrote:

> Absolutely clear as mud :P
sorry ... I'm not too good with expressing my SQL needs, I'm afraid,

Thanks for trying :}


In the end I got it sorted with the following
select dm.docnum, dm.alias1, dm.docname, dm.alias2 as "Status", dm2.alias2 as "Reply"
from docmaster as dm
left outer join ( select     alias1,     subclass_alias,     alias2,     entrywhen   from docmaster   where
subclass_aliasin ('Reply','MinTR')   and alias2 in ('PENDING','COMPLETED') ) as  dm2
 
on dm2.alias1 = dm.alias1
where dm.subclass_alias='Post' and alias2 in ('PENDING','REDRAFT');


Cheers,
Andrej

-- 
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm


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