sql server - SQL - Choose which field to select -
ok, title may bit strange, i'm trying doesn't seem quite complicated.
i have table mytable 2 fields defaultname , customname. make query selects customname if it's not null neither empty, otherwize defaultname not blank.
i'd grateful or link related post.
sql server syntax:
select case when customname not null , customname <> '' customname else defaultname end customername mytable
Comments
Post a Comment