Tuesday, December 18, 2007

How to implement if-then-else comparing strings in a select clause

How to implement if-then-else comparing strings in a select clause
----------------------------------------------------------------------------------

SELECT ISNULL( SUBSTRING( 'Petit', CHARINDEX( 'SMALL', PRODUCT_SIZE ), 255 ), 'Grand' )
FROM PRODUCTS

No comments: