Subject | Re: Natural Joins and SELECT queries |
---|---|
Author | robert_difalco |
Post date | 2003-04-12T16:57:23Z |
Thanks so much Berenger. I'm sorry for the niave questions but I'm
having trouble parsing all the SQL documentation. Are these
equivalent?
SELECT t1.oid, t2.name, t3.date
FROM t1
JOIN t2 ON t2.id = t1.id
JOIN t3 ON t3.id = t2.id // <-- = t2.id
WHERE <some search>
SELECT t1.oid, t2.name, t3.foo
FROM t1
JOIN t2 ON t2.id = t1.id
JOIN t3 ON t3.id = t1.id // <-- = t1.id
WHERE <some search>
SELECT t1.oid, t2.name, t3.foo
FROM t1
JOIN t2 ON t2.id = t1.id
JOIN t3 ON t2.id = t3.id // <-- 2 = 3
WHERE <some search>
Robert
--- In ib-support@yahoogroups.com, Berenger Enselme <BEnselme@N...>
wrote:
having trouble parsing all the SQL documentation. Are these
equivalent?
SELECT t1.oid, t2.name, t3.date
FROM t1
JOIN t2 ON t2.id = t1.id
JOIN t3 ON t3.id = t2.id // <-- = t2.id
WHERE <some search>
SELECT t1.oid, t2.name, t3.foo
FROM t1
JOIN t2 ON t2.id = t1.id
JOIN t3 ON t3.id = t1.id // <-- = t1.id
WHERE <some search>
SELECT t1.oid, t2.name, t3.foo
FROM t1
JOIN t2 ON t2.id = t1.id
JOIN t3 ON t2.id = t3.id // <-- 2 = 3
WHERE <some search>
Robert
--- In ib-support@yahoogroups.com, Berenger Enselme <BEnselme@N...>
wrote:
>this?
>
> > -----Original Message-----
> > From: Robert DiFalco [mailto:rdifalco@t...]
> > Sent: Monday, March 31, 2003 2:31 PM
> > To: ib-support@yahoogroups.com
> > Subject: RE: [ib-support] Natural Joins and SELECT queries
> >
> >
> > Thanks Berenger. So if I had three related tables would I do
> >NamedPersistent.oid=Persistent.oid)
> > SELECT Persistent.oid, name FROM
> > Persistent JOIN NamedPersistent on
> > NamedPersistent.oid=Persistent.oid,
> > NamedAndDatedPersistent JOIN NamedPersistent on
> > NamedPersistent.oid=NamedAndDatedPersistent.oid
> > WHERE name="foo"
> >
>
> SELECT Persistent.oid, name FROM
> (Persistent JOIN NamedPersistent on
> JOIN NamedAndDatedPersistent ON
> NamedPersistent.oid=NamedAndDatedPersistent.oid
> WHERE name="foo"
>
> would probably be better !
>
> Berenger