Questions tagged [ifnull]

This tag refers to the process of determining whether or not a particular object is null, and then running certain code based off of that condition.

Use this tag for questions related to running certain code depending on whether or not one or more objects is null.

161 questions
0
votes
1 answer

IFNULL around a complicated Case Function select column

How do I fix my IFNULL so that it doesn't break the below? If I remove the IFNULL than it works fine, but I need to calculate data off that column and need to get rid of the null values and replace with a 0. IFNULL(CASE WHEN A.Industry =…
0
votes
0 answers

Updating with JOIN using BigQuery

I am trying to populate null values. Using the ParcelID I can see that the data is there, just some columns are empty. This is the code I have so far: UPDATE `utility-binder-333917.housing_data.nashville_housing` SET PropertyAddress =…
0
votes
1 answer

MySQL subtract from Count Null

I have a movie rental Database where I have to calculate how many copies of a given movie I have available. I Have 3 tables: a) "Movies" -Id_Movie PK, -Name, -Copies_num b) "Client" -Id_Client PK, -Client_Name c)"rentals" Movie_Id PK FK, Client_ID…
Y4cob
  • 3
  • 1
0
votes
0 answers

DragonSoul.cpp:516:18: warning: the compiler can assume that the address of 'aItemPoses' will never be NULL [-Waddress]

I am getting a warning when compiling with gcc11 c++20. Can you help me solve it? ERROR: DragonSoul.cpp:516:18: warning: the compiler can assume that the address of 'aItemPoses' will never be NULL [-Waddress] DragonSoul.cpp:516:9: warning:…
Nebi S.
  • 1
  • 1
0
votes
1 answer

Fetch last available value if there is NULL

I have a table that is essentially a purchases table that has purchase prices. When a purchase is made, it is recorded at an hour. Like in the table, ABC-123 was purchased on 2022-1-20 at 12:00. I want the NULL values to show 20 as long as a new…
0
votes
4 answers

Dart check if many variable is null

Hello im new in dart language, is someone can help me to write this condition better, it works but it's a lot repetitive and i feel theres a better ways to write it : if (var1 != null || var2 != null || var3 != null || var4 != null || var5 !=…
0
votes
1 answer

why am I not getting a value in the ifnull from rails

I've got a query (it's quite long, but here's the gist of it) Name.find_by_sql(['SELECT IFNULL(users.last_name, "nil") FROM users JOIN user_groups ON user_groups.user_id = users.id JOIN groups ON groups.id =…
pedalpete
  • 21,076
  • 45
  • 128
  • 239
0
votes
2 answers

Group By, IFNULL and Order By date

I have to take the rows of my table grouped by types, if they are not null, and user. Order them by time. But the grouping must be separated... This is my table: id event_code user time 10 A 6 2021-10-20 09:59:00 9 null 6 2021-10-20…
gasmor
  • 59
  • 5
0
votes
1 answer

IFNULL function in Tableau

I'm trying to create a calculated field in Tableau - but for the below it says am missing an operator, how would it be? IFNULL([Translator], [Translation Requestor 1]) THEN "NULL" ELSE "Not NULL" END
0
votes
0 answers

SQLITE printf only for non-null SELECT values

value NameOfField 1 SlNo 10/3/21 ManfDate 2 SlNo NULL ManfDate 3 SlNo 11/3/21 ManfDate My current sqlite query structure- SELECT printf ("Item_No: %s Manufacturing_Date:%s ",(SELECT val from Orders WHERE name='Slno'),(SELECT…
user1234
  • 1
  • 1
0
votes
0 answers

How to write Case statement or IF ELSE (possibly) statement within IFNULL

I am trying to use Case statement or IF ELSE statement within IFNULL function to specify in more details of options. If I uncomment the IF statement where it starts with IF(t.Type_id IN (7777 , 9999), it would not cause error, but when I try to use…
Java
  • 1,208
  • 3
  • 15
  • 29
0
votes
0 answers

How to ignore the NULL while summing in a MYSQL query?

Any help to understand what is (not) happening would be appreciated. I have read most questions about sum NULL issues, googled and thought I understood how to deal with this; but in this bit of code I just can't see the solution. The Brief: For my…
ereceles
  • 13
  • 4
0
votes
2 answers

SSRS 2008 R2 Remove White Space if Null

I have a simple SQL Server 2008 R2 report with a textbox containing a few fields. I want to suppress the line if the value of a field is null. What would be the syntax for the expression? So my fields…
2boolORNOT2bool
  • 557
  • 3
  • 9
  • 23
0
votes
1 answer

MYSQL: Stop IFNULL returning "empty" rows of null

I'm using IFNULL in the following way: SELECT name, address, birthday, IFNULL(GROUP_CONCAT(pet_name), 'none') AS `pets_names` FROM pets WHERE user_id = 1; However, If I have no user 1, and therefore no results, I will get a single row where all…
0
votes
0 answers

Unexpected BLOB results with MySQL testing NULL variable with IFNULL, COALESCE

In trying to test whether a variable has been defined, I discovered that the IF, IFNULL, and COALESCE statements return simply BLOB rather than the value I expected when (a) the variable has not been defined or (b) it has been explicitly set to NULL…
Mike Blyth
  • 4,158
  • 4
  • 30
  • 41