0

Here is an example of the TABLE that I have:

ID   |  Locale | GUID
088 US tasffsddf124312
088 US
088 US tasffsd321123

I want to be able to ONLY select users WITH data in the GUID-column and exclude the ones with no data in the GUI-column.

Here is what I have:

SELECT *
FROM table_name
WHERE TACTIC_ID = '0088'
    AND LOCALE = 'US'
    AND ACTIVE = '1'
    AND TRIM(IFNULL(GUID, '')) <> ''

This does not work in Marketing Cloud.

4

Checking for GUID IS NOT NULL should work:

SELECT *
FROM table_name
WHERE TACTIC_ID = '0088'
    AND LOCALE = 'US'
    AND ACTIVE = '1'
    AND GUID IS NOT NULL
  • I think you mean "AND GUID IS NOT NULL". Null matches nothing, so that last line would evaluate to false whether GUID is null or populated with some value. – Macca May 16 '17 at 4:43
  • If you want to filter out empty values ('') as well as NULL then you may want to do: AND ISNULL(GUID, '') <> '' – Jim Nagorka May 22 '17 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.