Questions tagged [isnull]

`ISNULL` is a proprietary SQL function that replaces NULL with the specified replacement value.

ISNULL is a SQL function that replaces NULL with the specified replacement value.

The ANSI/ISO SQL standard function COALESCE serves the same purpose, and is widely implemented.

Reference

MSDN Article

706 questions
5
votes
3 answers

Pandas DataFrame Isnull Multiple Columns at Once

Given the following: import pandas as pd import numpy as np df = pd.DataFrame({'a':[np.nan,1,2],'b':[np.nan,np.nan,4]}) a b 0 NaN NaN 1 1.0 NaN 2 2.0 4.0 How do I return rows where both columns 'a' and 'b' are null without having to…
Dance Party2
  • 7,214
  • 17
  • 59
  • 106
5
votes
4 answers

Why IsNull is twice slow as coalesce (same query)?

We met a strange situation on SQL Server 2008 (SP1) - 10.0.2531.0 (X64) - Win2008 SP2 (X64). Here is a one heavy query: select t1.id, t2.id from t1, t2 where t1.id = t2.ext_id and isnull(t1.vchCol1, 'Null') = isnull(t2.vchCol1, 'Null') …
zmische
  • 809
  • 3
  • 13
  • 23
5
votes
1 answer

Check if a GameObject has been assigned in the inspector in Unity3D 2019.3.05f

Question: How to check if a public gameObject of a MonoBehaviour has been assigned in the inspector in Unity3D, as the comparison for null (object==null) fails. Concrete Example: I am about to write a generic method for Unity3D, that can be…
DaveM
  • 789
  • 1
  • 7
  • 16
5
votes
4 answers

Crystal Reports formula: IsNull + Iif

There are hints of the answer to this question here and there on this site, but I'm asking a slightly different question. Where does Crystal Reports document that this syntax does not work? Trim({PatientProfile.First}) + " " + Trim(Iif( …
SarekOfVulcan
  • 1,348
  • 4
  • 16
  • 35
5
votes
1 answer

Split Pandas DataFrame on Blank rows

I have a large dataframe that I need to split on empty rows. here's a simplified example of the DataFrame: A B C 0 1 0 International 1 1 1 International 2 NaN 2 International 3 1 3 International 4 1 4 …
MetaStack
  • 3,266
  • 4
  • 30
  • 67
5
votes
1 answer

What is IsNull in HQL?

How to write an HQL query like this SQL Query? SELECT IsNull(name, '') FROM users When I search for HQL IsNull, All results are for IS NULL or IS NOT NULL
ehsan shirzadi
  • 4,709
  • 16
  • 69
  • 112
5
votes
1 answer

Are conditions without ISNULL stinky?

I come across an article describing different situation in which the SQL code is probably not correct. However, there is one point which is surprising to me. They claim it is wise to explicitly handle NULLs in nullable columns, by using COALESCE…
Radim Bača
  • 10,646
  • 1
  • 19
  • 33
5
votes
5 answers

MySQL - Which way is better to check if a column is null or empty

Well, when we are going to select records which include nothing in a column, we can use this: SELECT * FROM my_table WHERE NULLIF(my_column, '') IS NULL; But, in most cases, I see developers use this: SELECT * FROM my_table WHERE my_column IS NULL…
Mojtaba
  • 4,852
  • 5
  • 21
  • 38
5
votes
3 answers

Using ISNULL in where Clause doesn't return records with NULL field

Table: ID AppType AppSubType Factor 1 SC CD 1.0000000000 2 SC CD 2.0000000000 3 SC NULL 3.0000000000 4 SC NULL 4.0000000000 Query: declare @ast varchar(10) set @ast = null select * from tbl where AppType =…
user1842048
  • 73
  • 1
  • 2
  • 5
5
votes
1 answer

Where Clause Rejecting Rows if NULL occurred

A Theory Question... When a set of queries as given below is fired then... Create table Temp1(C1 varchar(2)) Create table Temp2(C1 varchar(2)) insert into Temp1 Values('A'),(NULL),('B') insert into Temp2 Values('B'),(NULL),('C'),(NULL) select *from…
Romesh
  • 2,291
  • 3
  • 24
  • 47
5
votes
3 answers

Comparing Null to Null in merge statement

Which statement is perfect or better when dealing with billion of records for comparing NULL's in merge statement. I have tried with SET ANSI_NULLS OFF but that didn't work in merge statement. Here is my two ways ISNULL(SRCColumn,-11111) =…
Zerotoinfinity
  • 6,290
  • 32
  • 130
  • 206
5
votes
1 answer

Why should is_null() not be used?

Running CodeSniffer PHP style tests gave me the following error: The use of function is_null() is forbidden Squiz.PHP.ForbiddenFunctions.Found Why would use of is_null() be forbidden?
8128
  • 969
  • 1
  • 8
  • 27
5
votes
1 answer

How to use IS NULL in a parametrized query (Delphi)

I got statements like this: SELECT * From Table WHERE Feld IS NULL SELECT * From Table WHERE Feld IS NOT NULL Now I'm wondering how I could parametrize this query: SELECT * From Table WHERE Feld IS :Value As I cannot pas 'NOT NULL' to a parameter,…
user1619275
  • 355
  • 1
  • 6
  • 14
4
votes
3 answers

ISNULL function within select command of formview

This is part of my select statement within an formview which works fine till it hits a null value during the update process. (SELECT TOP 1 F.tel_id FROM TELEPHONE as F where F.tel_type_id = 3 AND F.client_id = @id ORDER BY sort_no ) AS faxid so i…
debutante
  • 105
  • 1
  • 3
  • 14
4
votes
4 answers

Null substitution in SQLite:

In Sybase and MSSqlServer TransactSQL, we have a function IsNull(columnName,valueForNull) to return a typed default value when a column value is null. How can I replicate this functionality in SQLite? Example in TransactSQL: select…
Vector
  • 10,879
  • 12
  • 61
  • 101