Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Complex Case When Statement

Author  Topic 

Johnph
Posting Yak Master

103 Posts

Posted - 2012-08-23 : 10:08:13
Hello!

I am kind of stuck writting a case statement and need assistance. Sorry for the formatting, the columns are seperated by @@@@.

I have a table with two columns:

COLUMN1 @@@@@@@@@@@@@ COLUMN2

LION-TIGER-MOUSE @@@@@@@@ A.BAT
LION-TIGER-MOUSE @@@@@@@@ AB.CAT

I need the output to be:

COLUMN1 @@@@@@@@@@@ COLUMN2

LION @@@@@@@@@@@@@@ CAT
TIGER @@@@@@@@@@@@ CAT
MOUSE @@@@@@@@@@@@ CAT
LION @@@@@@@@@@@@@ BAT
TIGER @@@@@@@@@@@@ BAT
MOUSE @@@@@@@@@@@@ BAT

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-23 : 10:13:47
see scenario 4

http://visakhm.blogspot.com/2010/01/multipurpose-apply-operator.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -