sql - joining two tables and overwriting one colum -


i trying join tables image attached shows,

table 1 have same records table 2 except 1 field not equal

i merge them have extended table :

  1. have records table2, if ignore isempty field, table 1 in table2

  2. when table1.isempty=1 , merged result have isempty=1, , record overwritten

check attached images more details

enter image description here

enter image description here

enter image description here

the table 3 shown, have records table 2 overwritten when necessary

select a.id, a.name, a.desc, case b.isempty                 when 1 1                 else a.isempty                 end case isempty  table2 left join table1 b on a.id=b.id 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -