-1

I have two tables as follows TableA as

col1 col2 col3 col4
1     2     3    4
101   201   301  401

AND another table- tableB

col1 col2 col3 col4
1     2     3    4

Result tableC or result should be

Result

col1 col2 col3 col4 col5 col6 col7 col8

1     2    3    4    1    2    3     4
101   201  301  401  null null null  null

Basically want to save the common rows in the table wherever available. I am using MYSQL

Rick James
  • 135,179
  • 13
  • 127
  • 222
syncdm2012
  • 445
  • 2
  • 10
  • 22

1 Answers1

1
select * from TableA a left join TableB b
on a.col1 = b.col1 and a.col2 = b.col2 and a.col3 = b.col3 and a.col4 = b.col4
solomon1994
  • 386
  • 2
  • 10