There's a good reason to use the new style of joins: because they are more
powerful.
Here is an example of a query that, to my knowledge, can't be done with *=
syntax:
select *
from t1 left outer join t2
on (t1.id = t2.id and t1.rating < t2.max_rating)
This is very different from:
select *
from t1 left outer join t2
on (t1.id = t2.id)
where t1.rating < t2.max_rating
....so it must be different than the *= style
This kind of complex outer join is what "educated" me to the new style of
joins, and I've used them ever since. (And they read better too.)
-----Original Message-----
From: Matt Osbun [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 05, 2005 11:18 AM
To: CF-Talk
Subject: RE: SQL prob
Why? Not a challenge, but a question. Using *= or (+) always seemed,
at least to me, quicker, easier, and easier to read afterward.
Now, I admit that I mostly got into the habit because, until fairly
recently, I was stuck on an Oracle platform that was too old to use
INNER JOIN/LEFT JOIN, but how much does it really matter?
Matt Osbun
Web Developer
Health Systems, International
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 05, 2005 9:42 AM
To: CF-Talk
Subject: RE: SQL prob
This is the OLD way to perform a join - it should be avoided.
-----Original Message-----
From: David Manriquez [mailto:[EMAIL PROTECTED]
Sent: 05 April 2005 15:48
To: CF-Talk
Subject: RE: SQL prob
Another way
SELECT r.eventID, d.title
FROM Events r,EventDescription d
WHERE d.eventID *= r.eventID
David Manriquez
Desarrollador de Sistemas
[EMAIL PROTECTED]
(+56-2) 43 00 155
-----Mensaje original-----
De: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Enviado el: Martes, 05 de Abril de 2005 10:17
Para: CF-Talk
Asunto: RE: SQL prob
You are using an INNER JOIN - you need to use a LEFT JOIN I believe.
SELECT r.eventID, d.title
FROM Events r
LEFT JOIN EventDescription d
ON WHERE d.eventID = r.eventID
-----Original Message-----
From: Dave Francis [mailto:[EMAIL PROTECTED]
Sent: 05 April 2005 15:18
To: CF-Talk
Subject: OT:SQL prob
SQL Server 7.
<cfquery name="q1" datasource="newStuff">
SELECT r.eventID, d.title
FROM Events r,
EventDescription d
WHERE d.eventID = r.eventID
</cfquery>
This query only returns rows from "Events" table that have eventID
present in "EventDescription" table. I need to return ALL rows from
Events table whether thay have a description or not.
As ever, thanks in advance,
Dave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201553
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54