| | |
What is the main Differences between Null value and blank?
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
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..
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
Good explanation shanti.
I would also say that null is much easiet to query for than a blank value.
I would also say that null is much easiet to query for than a blank value.
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
if you need to filter out empty strings
filter out nulls
if you need both, just combine
MySQL Syntax (Toggle Plain Text)
SELECT * FROM table WHERE LENGTH(COLUMN) > 0
filter out nulls
MySQL Syntax (Toggle Plain Text)
SELECT * FROM table WHERE COLUMN IS NOT NULL
if you need both, just combine
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
•
•
Join Date: Dec 2009
Posts: 1
Reputation:
Solved Threads: 0
0
#7 18 Days Ago
i use this on a daily basis
or other variations ....
sql Syntax (Toggle Plain Text)
SELECT * FROM table WHERE isnull(COLUMN,'') = ''
sql Syntax (Toggle Plain Text)
SELECT * FROM table WHERE NOT isnull(COLUMN,'') = '' SELECT * FROM table WHERE isnull(COLUMN,'') <> ''
Last edited by peter_budo; 10 Days Ago at 3:35 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
![]() |
Similar Threads
Other Threads in the MySQL Forum
- Previous Thread: insert pictures
- Next Thread: Database Programming?
Views: 2701 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for MySQL
1 agplv3 alfresco api artisticlicense aws bizspark breathalyzer camparingtocolumns cmg communityjournalism contentmanagement contractors copyright count court data database design developer development distinct drupal dui eliminate email enter enterprise error eudora facebook form foss gnu government gpl greenit hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire law legal license licensing maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle pdf penelope php query referencedesign reorderingcolumns resultset saas search select sharepoint simpledb sourcecode spotify sql statement sugarcrm syntax techsupport thunderbird transparency update virtualization






