From: laredotornado on
Hi,

I'm using SQL Server 2005. What I want is to return a column "venue",
but if that column is null, I want to return the value of the column
"site" (in either case, I want the column header to be "venue"). How
do I construct such a query?

Thanks, - Dave
From: Plamen Ratchev on
You can use expression with COALESCE and alias the expression as
venue:

SELECT COALESCE(venue, site) AS venue...

--
Plamen Ratchev
http://www.SQLStudio.com
From: Gert-Jan Strik on
Try this:

SELECT COALSECE(venue, site) AS venue
FROM my_table

--
Gert-Jan

laredotornado wrote:
>
> Hi,
>
> I'm using SQL Server 2005. What I want is to return a column "venue",
> but if that column is null, I want to return the value of the column
> "site" (in either case, I want the column header to be "venue"). How
> do I construct such a query?
>
> Thanks, - Dave