JOIN

From: "Grant Furick" <furick1(at)attglobal(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: JOIN
Date: 2001-03-21 21:16:05
Message-ID: 99b5n5$28r8$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to output news. An article can have an image or not sometimes.
Can someone help me get this to work in Postgres?

select a.article_id, a.title, a.url, a.synopsis, a.publish_date,
c.parent_category_id, c.category_id, c.category_name,
i.server_image_name
from ((article a JOIN article_category_assoc acs ON a.article_id =
acs.article_id)
JOIN category c ON c.category_id = acs.category_id)
LEFT OUTER JOIN (image i JOIN article_image_assoc aia ON i.image_id =
aia.image_id)
ON a.article_id = aia.article_id
where i.image_type_id = 1
and a.live_date <= #CreateODBCDate(Now())#
and a.active_ind = TRUE
and a.status_id = 2
and c.category_id=#intCategoryID#

Thanks

Responses

  • Re: JOIN at 2001-03-22 21:15:47 from Richard H

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-03-21 21:17:58 Re: New Book: PostgreSQL: The Elephant Never Forgets
Previous Message Gilles DAROLD 2001-03-21 20:53:46 Re: [HACKERS] Call for platforms AIX 4.3.3 Failed