hey..
i have two tables having three same columns..
so when i m using join on them its not returning me any output..
is it is necessary only to have a single matching column???
plz help..........
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 3, 2011, 8:41 PM EDT
no, its not necessary to have join on single column......
but data is not coming might be because of their is no matching data for strictly all 3 joins......so better is put join on single peimary key column.
Thanks,
Pravin.
Akash AhlawatRank #3,915 · 379 reputationPosted Nov 3, 2011, 9:26 PM EDT
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 3, 2011, 9:33 PM EDT
Akash AhlawatRank #3,915 · 379 reputationPosted Nov 3, 2011, 10:20 PM EDT
Akash AhlawatRank #3,915 · 379 reputationPosted Nov 3, 2011, 10:20 PM EDT
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 4, 2011, 1:13 AM EDT
see, we apply join on two tables n here you hav 1 common column between table1 n table 2 and table2 n table 3......
so can have join.
e.g:- select * from table1 t1 join table2 t2 on t1.t1colmn=t2.t1colmn
join table3 t3 on t2.t2colmn=t3.t2colmn
thats it......
Thanks,
Pravin.
Syed Nayab Ali33 reputationPosted Nov 4, 2011, 10:35 AM EDT
it is not necessary to make join only on one column.
Multiple column can be use in join, it will help you to filter data more specificly.
Try to use following syntax to get result
Select a.column1, a.column3, b.column2 from Table1 a join Table2 b
on a.column1 = b.column1
and a.column2 = b.column2
and a.column3 = b.column3
I m not understanding why u r not getting any return,
can you put ur code here so we can find out mistake.
Thanks
Please click on "Accepted Answer" if it helps you
Suthish NairRank #92 · 22.8K reputationPosted Nov 6, 2011, 4:02 AM EST