Skip to content
Advertisement

Tag: sql-null

Query not returning expected data

I’m looking for an explanation for why 1 of the following 3 queries aren’t returning what I am expecting. Assume the following: Anmodning with ANNo=1, ANCpr=1111112222 And the Person table doesn’t have a row with PSCpr=111111-2222 Queries are executed in Management Studio against a SQL Server 2017. Queries 2 and 3 returns the Anmodning row as expected but query 1

Mapping two columns into one column in Athena

I have data in the Athena something like this: However, the table owner changed the provider to provider_new. Thus, after 2020-08-01 the provider returns to NULL. Here is my query: How can I map these two columns to one? Thanks in advance. Answer Do you want coalesce()? coalesce() returns the first non-null value of the arguments it is given.

Advertisement