I have a table dbo.People in a database and one of the columns is Name. Some of the fields however are missing a Name value. So I am trying to replace the empty field with No Name. There is also an ID column with values 1, 2, 3, 4, and so on.
What I have so far:
SELECT ISNULL(Name, 'No Name') FROM dbo.People;
I then want to group and count how many times that name occurs
SELECT COUNT(ID), Name
FROM dbo.People
GROUP BY Name;
This works, however my result still shows a blank value with how many times that blank value occurs, rather than No Name.
ISNULL(Name, 'No Name' )in your second query at allSELECT. You need to useUPDATEif you want it changed forever, or include theISNULLagain on your 2nd query.ISNULL()is not updateNULLvalues. It just display asNo Name..-32768for nulls orNaNwhen a null indicates that universally.COALESCE()instead of that oldISNULL()...