Skip to main content

Hi @janpeter.van.d​ / @Celopeers .​ 

 

I need to query Table A and look for all distinct Machinename . After that I need to update Table B, If Machinename exists so ok. If not, need to create new lines in Table B with 'No ID' field at location

 

TableBTableA

Hello Ricardo,

 

Do you want to do this in Vertica?

Maybe something like this:

 

SELECT

CASE WHEN ColumnC in (SELECT Machinename FROM TableA)

THEN ColumnA

ELSE 'NO ID' END AS ColumnA

, ColumnB

, ColumnC

FROM TableB


Reply