Re: ANSI Join improvement

From: <kvnkrkptrck_at_gmail.com>
Date: 21 Jun 2006 13:20:15 -0700
Message-ID: <1150921215.865280.214680_at_g10g2000cwb.googlegroups.com>


Dieter Noeth wrote:
> kvnkrkptrck_at_gmail.com wrote:
>
> > SELECT DEPT.Dept_id "Department ID", Name "Department Name",
> > SUM(Salary) "Total Salary"
> > FROM DEPT JOIN EMP
> > ON EMP.Dept_id = DEPT.Dept_id
> > GROUP BY DEPT.Dept_id, Name;
> >
> > I would love to see a middle ground:
> > SELECT Dept_id "Department ID", Name "Department Name", SUM(Salary)
> > "Total Salary"
> > FROM DEPT JOIN EMP ON Dept_id
> > GROUP BY Dept_id, Name;
>
> You almost got it...
> It's already there since SQL92, the syntax is sligthly different :-)
>
> <named columns join> ::=
> USING <left paren> <join column list> <right paren>
>
> SELECT Dept_id "Department ID", Name "Department Name", SUM(Salary)
> "Total Salary"
> FROM DEPT JOIN EMP USING (Dept_id)
> GROUP BY Dept_id, Name;
>
> Some DBMSes support it, e.g. Oracle, PostgreSQL, mysql
>
> Dieter
Wow. This deep blue, hand-shaped bruise across my brow is going to take a long time to heal...

(thanks) Received on Wed Jun 21 2006 - 22:20:15 CEST

Original text of this message