select COALESCE(col1,'X') AS col1 from table1
- Lukasz Szozda
Also IsNull(Col1, 'RepalceValue') dang enter key COALESCE allows for multiple replace values such as COALESCE(Col1, Col2, 'ANother') checks if each is null down the chain
- SCFi
This kinda feels a lot like a homework question...
- Zane
3 Answers
1
votes
Try,
Select x.Col1
FROM Table1 x INNER JOIN Table2 y
ON (x.Col1 = y.Col1 or x.Col1 is NULL and y.Col1 is NULL)
0
votes
Use ISNULL(col1,'X'), this will return the value of col1 if it is not null , else it will return the default value 'X'
select ISNULL(col1,'X') from table1
0
votes
SELECT x.Col1
FROM table1 x
INNER JOIN table2 y on ISNULL(x.Col1, 'X') = ISNULL(y.Col1, 'X')
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
select COALESCE(col1,'X') AS col1 from table1- Lukasz Szozda