Re: syntax of outer join in 7.1devel

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Poul L(dot) Christiansen" <poulc(at)cs(dot)auc(dot)dk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: syntax of outer join in 7.1devel
Date: 2001-01-23 03:50:49
Message-ID: 200101230350.WAA02818@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


See the updated FAQ on our web site for syntax.

[ text/html is unsupported, treating like TEXT/PLAIN ]

> <html><head></head><body>Using the example:<br>
> SELECT '' AS "xxx", *<br>
> FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i);<br>
> <br>
> ..doesn't work because the columns which I am using to join the tables don't
> have the same name. How do i specify the columns if they don't have the same
> name?<br>
> <br>
> Poul L. Christiansen<br>
> <br>
> Tom Lane wrote:<br>
> <blockquote type="cite" cite="mid:6858(dot)976116402(at)sss(dot)pgh(dot)pa(dot)us"><pre wrap="">"Poul L. Christiansen" <a class="moz-txt-link-rfc2396E" href="mailto:poulc(at)cs(dot)auc(dot)dk">&lt;poulc(at)cs(dot)auc(dot)dk&gt;</a> writes:<br></pre>
> <blockquote type="cite"><pre wrap="">But how do I make an outer join? <br>What's the syntax?<br>I will RTFM if someone points me to the docs :-)<br></pre></blockquote>
> <pre wrap=""><!----><br>I'm afraid I haven't updated the FM yet :-( ... but you could look at<br>the examples in the JOIN regress test, src/test/regress/sql/join.sql.<br><br>Or, from the SQL92 spec, here's the grammar:<br><br> &lt;from clause&gt; ::= FROM &lt;table reference&gt; [ { &lt;comma&gt; &lt;table reference&gt; }... ]<br><br> &lt;table reference&gt; ::=<br> &lt;table name&gt; [ [ AS ] &lt;correlation name&gt;<br> [ &lt;left paren&gt; &lt;derived column list&gt; &lt;right paren&gt; ] ]<br> | &lt;derived table&gt; [ AS ] &lt;correlation name&gt;<br> [ &lt;left paren&gt; &lt;derived column list&gt; &lt;right paren&gt; ]<br> | &lt;joined table&gt;<br><br> &lt;derived table&gt; ::= &lt;table subquery&gt;<br><br> &lt;derived column list&gt; ::= &lt;column name list&gt;<br><br> &lt;column name list&gt; ::=<br> &lt;column name&gt; [ { &lt;comma&gt; &lt;column name&gt; }...
> </blockquote>
> <br>
> </body></html>
>
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Kientzle 2001-01-23 04:05:57 Re: Troubles with performances
Previous Message Prasanth Kumar 2001-01-23 03:03:07 Re: Data entry screen building utilities