pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Grant Furick <furick1@attglobal.net>
To: pgsql-sql@postgresql.org
Subject: LEFT JOIN
Date: Tue, 20 Mar 2001 18:00:08 -0500
Message-ID: <998ne9$1n0t$1@news.tht.net> (raw)

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





view thread (13+ messages)  latest in thread

Message-ID: <998ne9$1n0t$1@news.tht.net>
Permalink:  ../998ne9$1n0t$1@news.tht.net/
Also on:    postgresql.org/message-id/998ne9$1n0t$1@news.tht.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: furick1@attglobal.net
  Subject: Re: LEFT JOIN
  In-Reply-To: <998ne9$1n0t$1@news.tht.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox