SQL Help

Поиск
Список
Период
Сортировка
От luisblock@amauta.rcp.net.pe
Тема SQL Help
Дата
Msg-id 1068057020.3fa941bce468d@oficina.rcp.net.pe
обсуждение исходный текст
Список pgsql-sql
PLS, help,

I am trying to JOIN two tables together with the LEFT OUTER JOIN statement, but 
with a twist:

1. table 1 id and table 2 projectid are the join field
2. Table 1 has de detail info for several ocurrences in table 2.  For each id 
in table 1 (project detail), there are many entries of projectid on table 2 
(update log on project)
3. I need a query that gets each project detail (table 1) with ONLY the LAST 
(most recent) update date and comment (table 2) for that project.

The result report will look something like this:

Repeat____________________________________________________
PROJECT NAME(table 1)   PROJECT DATE(table 1)    PROJECT OWNER(table 1)
LAST UPDATE(table 2)    LAST UPDATE COMMENT(table 2)
Repeat_____________________________________________________

I have used the SELECT TOP 1 function, the DISTINCT function, I am out of ideas.

Thanx

LuisFe


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

Предыдущее
От: Cris Carampa
Дата:
Сообщение: transaction management in plpgsql functions
Следующее
От: Chris Bowlby
Дата:
Сообщение: Re: [HACKERS] Schema boggle...