Subsribe to our RSS

latest reactions

christian louboutin shoes
With that kind of traffic you want to ad …
Rahul Anand
Thanks for the nice post. It works for m …
Serkan
thx a lot! …
msb
Thanks for above solution.There is ano …
Lori S.
FYI, I was using this successfully in CF …

Use OpenDNS

mxna feeds

cfmailparam behaviour change in CF9.01ColdFusion Job Opportunity in Houston, TXFacial Recognition in 14 Lines Of ColdFusionColdFusion UPS PackageColdFusion Job Opportunity in Arlington, VAColdFusion Job Opportunity in San Diego, CASome ColdFusionBloggers.org GuidelinesColdFusion Positions In CaliforniaListChangeDelimsunix epoch with coldfusionQuery scripting bug in Coldfusion 9Scoth On The Rock 2011 Tickets on salefoursquareCFC updated to version 1.0, now includes ColdFusion return typeFramework One Birds of a Feather session at CFUnitedWhat makes you a good ColdFusion programmer?

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2010 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos Gallupa

Multiple conditions in JOIN statement

You can put multiple conditions in your LEFT, RIGHT and INNER/OUTER joins if you want.. below a small example that will give you the idea.

SELECT tbl.id, tblo.naam
FROM sometable tbl
  LEFT JOIN someothertable tblo ON tblo.id = tbl.id
   AND tblo.function = tbl.function
ORDER BY ....

Didn't know this one.. could have saved me a lotta query's in the past :-(

16997 viewed | 6 opinion(s)  | del.icio.us | Digg it | Tjarko @ 01/06/05 0:00 cet


Reactions:

nidhi wrote.... (mail)

it doesnt work !! dont misguide people with such posts!

14 March 2009 16:12 cet  

Tjarkowrote....

It works in sql server and oracle. Its probably your way of coding or your database.

14 March 2009 16:22 cet  

Bio wrote....

multiple conditions on a join is commonplace...or did i miss something?

20 April 2009 15:16 cet  

wese wrote.... (site)

It does work, as long as you know what your doing.
Joining on multiple columns doesn't work properly (5.0).
Adding extra conditions does.

03 June 2009 15:10 cet  

Johny wrote.... (site)

Never tried to join on multiple columns, just with extra condition, but i think also multiple columns should work.

15 October 2009 19:13 cet  

Rahul Anand wrote.... (mail)

Thanks for the nice post. It works for me. I dont know why it is not working for other people..anyway thanks for sharing such a nice post.

06 July 2010 6:39 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!