pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Abdul Wahab Dahalan <wahab@mimos.my>
To: pgsql-sql@postgresql.org
Subject: UNION or UNION ALL
Date: Thu, 13 Feb 2003 16:52:19 +0800
Message-ID: <3E4B5CC3.2C10E63A@mimos.my> (raw)

I've 3 tables A,B,C
records in table A like:
id          name
b1        abc
b2        xyz
b3        rst

records in table B like:
id        type
b1        logistics
b1        importer
b2        logistics
b3        logistics
b3        exporter

records in table C like:
id        offer        title
b1        sell        car
b1        buy        car
b1        sell        van
b2        sell        car

How shoul I do a query so that I can get a result like
(The query will be based on B.type ='logistics')
id        name       offer
b1        abc        sell
b1        abc        buy
b1        abc        sell
b2        xyz        sell
b3        rst            --

Any help very much appricated

view thread (2+ messages)  latest in thread

Message-ID: <3E4B5CC3.2C10E63A@mimos.my>
Permalink:  ../3E4B5CC3.2C10E63A@mimos.my/
Also on:    postgresql.org/message-id/3E4B5CC3.2C10E63A@mimos.my

 · 

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: wahab@mimos.my
  Subject: Re: UNION or UNION ALL
  In-Reply-To: <3E4B5CC3.2C10E63A@mimos.my>

* 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