Hello all,

I have the following query :

SELECT a,b,c FROM table WHERE a = 1

This returns

a => 1 (int)

b => 0 (int)

c => foobar (varchar)

I would like to return a varchar value for b depending on its int value, for example

if b = 0 return :

a => 1 (int)

b => There are no widgets (varchar)

c => foobar (varchar)

if b = 1 return :

a => 1 (int)

b => There is one widget (varchar)

c => foobar (varchar)

if b > 1 return :

a => 1 (int)

b => There are loads of widgets (varchar)

c => foobar (varchar)

I assume this can be done through some sort of IF/THEN/ELSE syntax but I am at a loss to finding a solution, so I would appreciate any guidance.