Re: join problem or maybe group :( - Mailing list pgsql-general

From Ben-Nes Michael
Subject Re: join problem or maybe group :(
Date
Msg-id 015501c24f6e$f5b6f400$aa0f5ac2@canaan.co.il
Whole thread Raw
In response to join problem or maybe group :(  ("Ben-Nes Michael" <miki@canaan.co.il>)
Responses Re: join problem or maybe group :(  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
hmmm, me again.

Ill attack the subject from another way.

Can i limit the left joined table to one result ?

like:

select * from table1 left join table2 using (column) limit table2 1,0; ?

> Hi All
>
>
> I want to select sections using left join on articles, but i want to
retrive
> only one row from articles per section and the one should be the latest
> art_date.
>
> Can it be done ?
>
> CREATE TABLE sections (
> sec_id SERIAL PRIMARY KEY,
> sec_name VARCHAR (30),
> sec_order INT2
> );
>
>
> CREATE TABLE articles (
> art_id SERIAL PRIMARY KEY,
> sec_id INT4 REFERENCES sections ON UPDATE CASCADE ON DELETE CASCADE,
> art_name VARCHAR (30),
> art_date DATE
> );
>
> Cheer
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: rules and functions as arguments
Next
From: Stephan Szabo
Date:
Subject: Re: join problem or maybe group :(