SQL How to write a NOT LIKE instruction

SELECT * FROM [Table] WHERE (Izdava NOT LIKE NULL) 

// how to check if Izdava is NULL

+4
source share
6 answers

This should work:

 SELECT * FROM [Table] WHERE Izdava IS NOT NULL 
+10
source
 SELECT * FROM [Table] WHERE (Izdava IS NOT NULL) 
+7
source

I think this is what you want.

 SELECT * FROM [Table] WHERE Izdara Is Not NULL 

NULL Information from MSDN :

The following is error information:

To check for null values ​​in a query, use NULL or IS NOT NULL in WHERE.

+5
source

LIKE NULL makes no sense. It does not make sense. LIKE is used to compare a partial string using wildcards or a complete string without wildcards.

Depending on the DBMS, you should NOT have NULL,

 SELECT * FROM [Table] WHERE (NOT Izdava IS NULL) 
+5
source

If you are checking for null, do not use a similar clause. Just write

 select * from tablename where columnmame is not null 
+3
source

If it is MSSQL or Oracle, do the following:

 SELECT * FROM [Table] WHERE Izdava IS NOT NULL 
+1
source

Source: https://habr.com/ru/post/1403672/


All Articles