I think Zack properly answered the question but just to cover all the bases:
CopyUpdate myTable set MyColumn = NULL
This would set the entire column to null as the Question Title asks.
To set a specific row on a specific column to null use:
CopyUpdate myTable set MyColumn = NULL where Field = Condition.
This would set a specific cell to null as the inner question asks.
Answer from Jeff Martin on Stack OverflowI think Zack properly answered the question but just to cover all the bases:
CopyUpdate myTable set MyColumn = NULL
This would set the entire column to null as the Question Title asks.
To set a specific row on a specific column to null use:
CopyUpdate myTable set MyColumn = NULL where Field = Condition.
This would set a specific cell to null as the inner question asks.
If you've opened a table and you want to clear an existing value to NULL, click on the value, and press Ctrl+0.
sql - Set default value in query when value is null - Stack Overflow
Assigning Null value to the variable โ SQLServerCentral Forums
SQL Query - Adding NULL results to a SELECT query - Stack Overflow
Need some knowledge on NULL and NOT NULL
Videos
Use the following:
SELECT RegName,
RegEmail,
RegPhone,
RegOrg,
RegCountry,
DateReg,
ISNULL(Website,'no website') AS WebSite
FROM RegTakePart
WHERE Reject IS NULL
or as, @Lieven noted:
SELECT RegName,
RegEmail,
RegPhone,
RegOrg,
RegCountry,
DateReg,
COALESCE(Website,'no website') AS WebSite
FROM RegTakePart
WHERE Reject IS NULL
The dynamic of COALESCE is that you may define more arguments, so if the first is null then get the second, if the second is null get the third etc etc...
As noted above, the coalesce solution is preferred. As an added benefit, you can use the coalesce against a "derived" value vs. a selected value as in:
SELECT
{stuff},
COALESCE( (select count(*) from tbl where {stuff} ), 0 ) AS countofstuff
FROM
tbl
WHERE
{something}
Using "iif" or "case" you would need to repeat the inline whereas with coalesce you do not and it allows you to avoid a "null" result in that return...
Try:
SELECT C.CustomerId, C.CustomerName, C.StatusId, I.AuthorityId
FROM Customer C
LEFT JOIN Identifier I ON I.CustomerId = C.CustomerId and I.AuthorityId = 11
WHERE C.StatusId = 1
ORDER BY C.CustomerName
just change JOIN into LEFT JOIN
SELECT C.CustomerId, C.CustomerName, C.StatusId, I.AuthorityId
FROM Customer C
LEFT JOIN Identifier I ON I.CustomerId = C.CustomerId
WHERE C.StatusId = 1
AND I.AuthorityId = 11
ORDER BY C.CustomerName
UPDATE
if you want to change (NULL) value into NULL or whatever word you want to replace, you can you COALESCE
SELECT C.CustomerId, C.CustomerName, C.StatusId, COALESCE(I.AuthorityId, 'whatever')
FROM Customer C
LEFT JOIN Identifier I ON I.CustomerId = C.CustomerId
WHERE C.StatusId = 1
AND I.AuthorityId = 11
ORDER BY C.CustomerName