From: | "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il> |
---|---|
To: | "postgres" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: join problem or maybe group :( |
Date: | 2002-08-29 15:15:50 |
Message-ID: | 015501c24f6e$f5b6f400$aa0f5ac2@canaan.co.il |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Olga | 2002-08-29 15:29:02 | SET TIME ZONE problem |
Previous Message | Gregory Seidman | 2002-08-29 15:01:23 | Re: Compiling 7.2.1 with JDBC-Support fails - help needed |