January 2nd, 2007, 03:20 PM
How to Delete Null Values
I have One table Inside the Table, One Column have null values .
how to delete the null values from the table .Please Help me.
January 2nd, 2007, 03:27 PM
Dleting values from tables
Its Very Simple Just goto Query Analyzer select Serve->Select Database ->Select Table. and Write a single line in Editor
DELETE FROM Table name
Comments on this post
January 3rd, 2007, 02:43 AM
You'll probably want to delete from table where column (values) is null.
Or do you want to update nulls to new values?
Or do you really want to empty the table?
September 6th, 2008, 08:53 PM
Re-opening an old thread ... I had a similar question..
I'd like to do the first option - delete rows that contain null values in a given colum. This:
Originally Posted by pabloj
doesn't find them (ie: deletes 0 rows..)
delete from MetaDataInfo where nodePath = NULL;
September 7th, 2008, 02:15 AM
There are two possible answers:
Originally Posted by drevicko
1) you don't have any rows with a null value in the column nodePath;
2) In SQL Server a null value and an empty value are two different things (at least for character data). So you probably want
delete from MetaDataInfo where nodePath = NULL OR nodePath = '';
September 7th, 2008, 02:21 AM
shammat, FYI, in every other database besides oracle, NULL and empty strings are different
the correct syntax is
if you want to delete rows which have NULLs and also rows which have empty strings, use
WHERE nodepath IS NULL
WHERE COALESCE(nodepath,'') = ''
September 7th, 2008, 02:59 AM
Yes I know
Originally Posted by r937
Side node: none of the other datatypes has the concept of an "empty value", so why do people feel character data needs it?
It sounded like drevicko assumed that an empty string and NULL is the same thing, so that's why I mentioned it.
Good catch, I simply copied the original statement.
Most probably the real reason why the initial statement did work...