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

Interview with ProGit Author, Scott ChaconColdFusion 9 Developer TutorialColdFusion MeetUp: Digging Into The Developer Toolbox, with Jim PriestColdFusion MeetUp: Using jQuery as a Proxy to ColdFusion, with Hal HelmsColdFusion Job Opportunity in Lexington, MAColdFusion Job Opportunity in Washington, DCColdFusion Job Opportunity in Rye, NYConfiguring Apache To Use Multiple Versions of ColdFusionFun with Decentralised Version ControlEscaping Form Values - Understanding The ColdFusion htmlEditFormat() Life CycleColdFusion Job Opportunity in Limburg, BelgiumColdFusion Job Opportunity in Colchester, Suffolk, United KingdomColdFusion Job Opportunity in Houston, TXUpdate to my 911 ViewerColdFusion Job Opportunity in Chico, CA

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 :-(

17993 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!!