You could try some sort of COALESCE trick, eg:
SELECT COALESCE( CASE WHEN condition1 THEN calculation1 ELSE NULL END, CASE WHEN condition2 THEN calculation2 ELSE NULL END, etc... )
More Related Contents:
- Add a column with a default value to an existing table in SQL Server
- Simulating group_concat MySQL function in Microsoft SQL Server 2005?
- How can I do an UPDATE statement with JOIN in SQL Server?
- The multi-part identifier could not be bound
- SQL Query to get aggregated result in comma separators along with group by column in SQL Server
- Fastest way to update 120 Million records
- Can a Check constraint relate to another table?
- Is it possible to select sql server data using column ordinal position
- How to find current transaction level?
- How to insert multiple records and get the identity value?
- How to Replace Multiple Characters in SQL?
- How can a LEFT OUTER JOIN return more records than exist in the left table?
- EXISTS vs JOIN and use of EXISTS clause
- “select * from table” vs “select colA, colB, etc. from table” interesting behaviour in SQL Server 2005
- Dynamic SQL to generate column names?
- SQL comma-separated row with Group By clause
- How to copy a huge table data into another table in SQL Server
- How to split string using delimiter char using T-SQL?
- Should I use SQL_Variant data type?
- Performance of SQL Server 2005 Query
- SQL server select distinct rows using most recent value only
- Script to save varbinary data to disk
- Measuring Query Performance : “Execution Plan Query Cost” vs “Time Taken”
- How to select date without time in SQL
- What is the internal representation of datetime in sql server?
- Eliminate and reduce overlapping date ranges
- SQL Server 2005 – Export table programmatically (run a .sql file to rebuild it)
- SQL Sort Order with Null values last
- Insert all values of a table into another table in SQL
- When to use EXCEPT as opposed to NOT EXISTS in Transact SQL?