2

I want to select top 1 value either null or value from this query

select top 1 column5 from table2 where table2.column1ID = 5

if the whole value of this column is null the return is empty , but I need to return value or null

4

1 回答 1

4

Wrap your select in another select.

select
  (
  select top 1 column5 
  from table2 
  where table2.column1ID = 5
  --order by ?
  ) as column5
于 2013-10-10T09:13:43.273 回答