I need to combine 2 columns in the same DB and table. (MS SQL Server 2008 ent.)
If columnA has a value AND ColumnB isNull Then use ColumnA value
If columnB has a value AND ColumnA isNull Then use ColumnB value
If both ColumnA AND ColumnB have values then use ColumnA value
This query gives me results I expect, but what would be the best way to do this?
Thanks
John Fuhrman
If columnA has a value AND ColumnB isNull Then use ColumnA value
If columnB has a value AND ColumnA isNull Then use ColumnB value
If both ColumnA AND ColumnB have values then use ColumnA value
This query gives me results I expect, but what would be the best way to do this?
SQL:
Select
case when A_FILE Is not null then A_FILE
when A_FILE Is null then LONG_A_FILE
end as upper(FileNumCombined)
From dbo.COMPLETED
Thanks
John Fuhrman