sql - Combining output of two queries -


table1:

col1   col2 john   new york jimmy  london jerry  mumbai jack   perth 

table2:

col1   col3 john   10 jimmy  20 jerry  40 jack   30 

query 1

select col1,col2 table1 

query 2 is

select col1,col3 table2 

now since col1 of both queries same, want merge both queries , require following o/p

col1   col2        col3 john   new york    10 jimmy  london      20 jerry  mumbai      40 jack   perth       30 

thanks.

try this,

select t1.col1     ,t1.col2     ,t2.col3 table1 t1 inner join table2 t2 on t1.col1 = t2.col1 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -