How do we identify the records in a table that has empty values [Resolved]

Posted by Rajesh123 under Oracle on 8/19/2015 | Points: 10 | Views : 482 | Status : [Member] | Replies : 3
How do we identify the records in a table that has empty values.

rajesh.plsql123@gmail.com


Responses

Posted by: Bandi on: 8/20/2015 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
You can make use of NULLIF as well as ISNULL built-in fucntions to identify empty values..

SELECT * FROM TableName
WHERE NULLIF( Column1, '') IS NULL

refer
http://www.w3schools.com/sql/sql_isnull.asp
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions102.htm

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Rajesh123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sheonarayan on: 8/19/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
We can use is null if the column is nullable and the value is null.
SELECT * FROM [TrainingDatabase].[dbo].[PersonalDetails] WHERE BirthDate is null

If the value of the column is empty, then use following
SELECT *  FROM [TrainingDatabase].[dbo].[PersonalDetails] WHERE FirstName = ''


Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Rajesh123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajesh123 on: 8/20/2015 [Member] Starter | Points: 25

Up
0
Down
k bandi
thanku

rajesh.plsql123@gmail.com

Rajesh123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response