hi marcel1,
below select with case clause is standard SQL1999. Maybe it works also on MS SQL Server.
SELECT x,
(
CASE
WHEN x = 'AB' and y like 'CD%' then 'CD'
WHEN 'ZZ' and y like 'CC%' then 'BA'
WHEN x in ('bbb','sss','ddg') then 'BB'
ELSE 'unknown thing'
END
) AS xx
FROM yourtable where ... ;
This will produce a list with two columns, for example
x xx
------------
AB CD
sss BB
wow unknown thing
You can also omit the first attribute x from the select, if you don't need original x values.
Like x, y must also be attribute of yourTable.
Maybe this will help you.
krs,
tesu