select CASE WHEN FirstColumn IS NULL THEN '' ELSE FirstColumn END + ' ' +
CASE WHEN SecondColumn IS NULL THEN '' ELSE SecondColumn END as ResultColumn
from myTable
serkan sendur
821
Postaholic
Banned
Recommended Answers
Jump to PostThat works. Also there is TSQL's ISNULL function.
SELECT ISNULL(FirstColumn, '') + ' ' + ISNULL(SecondColumn, '') AS ResultColumn FROM mytable
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.