![]() ![]() ![]() Insert into vendor (vendor_name,vendor_email) values ( 'Intel', NULL) Insert into vendor (vendor_name,vendor_email) values ( 'Oracle', '') Insert into vendor (vendor_name,vendor_email) values ( 'Microsoft', ' ') Insert into vendor (vendor_name,vendor_email) values ( 'IBM', ' ') Insert into vendor (vendor_name,vendor_email) values ( 'Dell', ' ') Here is the script to create the vendor table I was using as an example. Where vendor_email = '' or vendor_email is nullįinally, I want to show you a little trick that I have used on occasion to change all of the null values to empty strings and then compare the result to an empty string. If you want to combine them to search for the SQL null or empty string together and retrieve all of the empty strings and nulls all at once, you could do something like this. Next, I want to pull out the empty string using the tick-tick, or empty string. Let’s pull out the NULL values using the IS NULL operator. In this table, I specifically put in some email addresses that are both null and empty strings. Let’s take a look at the vendor table to demonstrate this. On the other hand, an empty string is an actual value that can be compared to in a database. It is a special “value” that you can’t compare to using the normal operators. How do you filter a SQL Null or Empty String?Ī null value in a database really means the lack of a value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |