Re: ANSI Join improvement
Date: Thu, 22 Jun 2006 22:30:46 -0400
Message-Id: <fc0sm3-2dd.ln1_at_pluto.downsfam.net>
kvnkrkptrck_at_gmail.com wrote:
> At the risk of being labeled a crank...
>
> I'm looking for someone to tell me whether my idea for improving the
> ANSI Join syntax has any merit. One thing about the current syntax
> that often strikes me is I usually join tables on identically named
> columns, and NATURAL joins are perfect for this situation:
>
> EMP = {Dept_id, Emp_id, FName, LName, Salary}
> DEPT = {Dept_id, Name}
>
> SELECT Dept_id "Department ID", Name "Department Name", SUM(Salary)
> "Total Salary"
> FROM DEPT NATURAL INNER JOIN EMP
> GROUP BY Dept_id, Name;
>
Only improvement might be the ability to join by naming a foreign key, in the event that there are two foreign keys between the same two tables.
SELECT ...
FROM a JOIN B using foreign key b.fk_to_a
-- Kenneth Downs Secure Data Software, Inc. (Ken)nneth_at_(Sec)ure(Dat)a(.com)Received on Fri Jun 23 2006 - 04:30:46 CEST