Home » SQL & PL/SQL » SQL & PL/SQL » Re: sql help for(3 condition st)
Re: sql help for(3 condition st) [message #19746] Fri, 05 April 2002 10:19
Sri DHAR
Messages: 22
Registered: March 2002
Junior Member
Try this one,

Select empno, sal,
decode(sign(10000.00 - sal), -1, 'HIGH',
Decode(sign(5000 - sal), - 1, 'MED',
DECODE(sign(1000 - sal), - 1, 'LOW', NULL)))
FROM emp
WHERE
decode(sign(10000.00 - sal), -1, 'HIGH',
Decode(sign(5000 - sal), - 1, 'MED',
DECODE(sign(1000 - sal), - 1, 'LOW', NULL))) IS NOT NULL

This approach will give you an access to put some functionality in the place of strings like 'HIGH', 'MED' or 'LOW'.

Let me know,
Thanks,
Sri DHAR
Previous Topic: How to retrieve the recordset from PROCEDURE????Who can give me an ASP sample???
Next Topic: Dump objects in SQL form
Goto Forum:
  


Current Time: Thu Mar 28 10:21:16 CDT 2024