sql code for big query node

Hello, I need help in using the DB Query node.
I have a Data List as follows:

TAB%201

My goal is to create a new “NOMINATIVE” field this way:

TAB%202

I tried a first query

SELECT *, CONCAT (DES_SURNAME, ‘’, DES_NAME) NOMINATIVE FROM # table # AS table

But then I can’t update the table by taking the Business Name field if the Name field is null

THANKS

I think you need a CASE WHEN statement

SELECT *
, CASE WHEN “BUSINESS NAME” IS NOT NULL OR trim(“BUSINESS NAME”) <> ‘’ THEN “BUSINESS NAME”
ELSE CONCAT (DES_SURNAME, ’ ', DES_NAME) END AS
NOMINATIVE
FROM # table # AS table

You migzt have to play around with the quotation marks. Some Programs do not like variable names with blanks.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.