-5

I would like to join two table keep all the records from the first and populate a given column of the first one with a record from the second

See the ss attached of the structure of the table (don't know how to keep the formatting i choose for the table here) thanksenter image description here

lal
  • 45
  • 4

1 Answers1

0

Why don't you just update the first table with the second table's data?

UPDATE `FirstTable` AS T1, `SecondTable` AS T2 
SET T1.cost = T2.cost
WHERE T1.Primary_key = T2.Primary_key;
Wesgur
  • 3,140
  • 3
  • 18
  • 28
  • thanks for your reply. My question wasn't really clear. i'm using a cloud datawahouse system that supports only join (outer, inner, left and right). so i can't use update. do you have any idea how i can do that? – lal Feb 10 '18 at 21:22