0
how to join left join of different tables
13 Respostas
0
suppose there are 3 tables : one, two, three
then query will be
SELECT o.columnname FROM one o
LEFT JOIN two t ON o.id = t.id
LEFT JOIN threr th ON th.id = o.id
considering three tables are linked with each other via id
0
in db2 database
0
you mean to say create a join from two different databases?
0
no. I have 3 tables in db2 and need to get result like. in first table I need Column one and second table 2 column and third table I need 3 column , how can use left join to get desired result
0
SELECT o.columnname, t.columnname, th.columnname FROM one o
LEFT JOIN two t ON o.id = t.id
LEFT JOIN threr th ON th.id = o.id
just select the columns as above by using table aliases
0
for more detail please give me the tables name and columns name you want to select and relation column between these three
0
in three tables I have unique I'd I,e employeeid
0
ok then just use table aliases and employeeid at ON clause like
ON o.employeeid = t.employeeid
0
I tried that query is executing but result unable to get querying the I did some thing wrong , it is very helpful to me if you write complete query
0
please post your query
0
OK tomorrow I will post my how I am doing the query
0
thank you
0
no problem