Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Problem in escaping the single quote in DECODE
Hi all,
I have the following query.
SELECT MAX(emptype_flg)
FROM employee
AND emptype_flg IN (DECODE ('emptype_flg', '*' , emptype_flg,
'S' , '*,S'));
The emptype_flg can contain values '*' or 'S'.
The problem is that when the emptype_flg contains value S, the SQL does not give any output. This is because the IN block contains ('*,S')
How can I get ('*', 'S') in the IN block so that the above query works???
Any pointers will be highly appreciated!!
Regards,
Antoshin Lazar.
Received on Mon May 21 2007 - 09:58:03 CDT