What is the main Differences between Null value and blank?

Reply

Join Date: Aug 2008
Posts: 22
Reputation: dharam_05 is an unknown quantity at this point 
Solved Threads: 0
dharam_05 dharam_05 is offline Offline
Newbie Poster

What is the main Differences between Null value and blank?

 
0
  #1
Sep 15th, 2008
Can anyone explain me what are the main difference between a null value and blank value in database. It important please help me out. thank you.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,076
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: What is the main Differences between Null value and blank?

 
0
  #2
Sep 15th, 2008
1.A NULL value represents the absence of a value for a record in a field (others softwares call it also a missing value).

2.An empty value is a "field-formatted" value with no significant data in it.

3.NULL isn't allocated any memory, the string with NUll value is just a pointer which is pointing to nowhere in memory. however, Empty IS allocated to a memory location, although the value stored in the memory is "".

4.Null has no bounds, it can be used for string, integer, date, etc. fields in a database. Empty string is just regarding a string; it's a string like 'asdfasdf' is, but is just has no length. If you have no value for a field, use null, not an empty string.

5.Null is the database's determination of an absense of a value logically, so to speak. You can query like: where FIELD_NAME is NULL
Last edited by Shanti Chepuru; Sep 15th, 2008 at 4:22 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 138
dickersonka dickersonka is offline Offline
Veteran Poster

Re: What is the main Differences between Null value and blank?

 
0
  #3
Sep 15th, 2008
Good explanation shanti.

I would also say that null is much easiet to query for than a blank value.
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 22
Reputation: dharam_05 is an unknown quantity at this point 
Solved Threads: 0
dharam_05 dharam_05 is offline Offline
Newbie Poster

Re: What is the main Differences between Null value and blank?

 
0
  #4
Sep 16th, 2008
Thanks guys but i have one query, if i have some null values and some empty string in the table and if i execute select * from from table. whether it will print fields having null and empty string ? what will be the o/p?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,076
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: What is the main Differences between Null value and blank?

 
0
  #5
Sep 16th, 2008
select * from tablename;
this statement will print all the columns, not the matter of null or empty..
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 138
dickersonka dickersonka is offline Offline
Veteran Poster

Re: What is the main Differences between Null value and blank?

 
0
  #6
Sep 16th, 2008
if you need to filter out empty strings
  1. SELECT * FROM table WHERE LENGTH(COLUMN) > 0

filter out nulls
  1. SELECT * FROM table WHERE COLUMN IS NOT NULL

if you need both, just combine
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Dec 2009
Posts: 1
Reputation: bwagner is an unknown quantity at this point 
Solved Threads: 0
bwagner bwagner is offline Offline
Newbie Poster
 
0
  #7
20 Days Ago
i use this on a daily basis
  1. SELECT * FROM table WHERE isnull(COLUMN,'') = ''
or other variations ....
  1. SELECT * FROM table WHERE NOT isnull(COLUMN,'') = ''
  2. SELECT * FROM table WHERE isnull(COLUMN,'') <> ''
Last edited by peter_budo; 12 Days Ago at 3:35 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 2708 | Replies: 6
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC