DECLARE @Type varchar(20)SET @Type = 'Programming'SELECTCASE @TypeWHEN 'Sql' THEN 'sqltutorials.blogspot.com'WHEN 'Programming' THEN 'programmingschools.blogspot.com'WHEN 'Travel' THEN 'travelyourself.blogspot.com'ELSE 'Not yet categorized'END
Value = programmingschools.blogspot.com
If SET @Type = 'Picture', then Return value = Not yet categorized
link : http://sqltutorials.blogspot.in/2007/06/sql-case-function.html
0 comments:
Post a Comment