Home » SQL & PL/SQL » SQL & PL/SQL » need how to make of exists operator
need how to make of exists operator [message #224081] Mon, 12 March 2007 23:23 Go to next message
frank.svs
Messages: 162
Registered: February 2006
Senior Member
Hi pals,

using EXISTS operator i need to display/output where the given employee no is existing or not i.e YES/NO.


select 1 from emp where empno=:v_empno


Regards,
franky
Re: need how to make of exists operator [message #224100 is a reply to message #224081] Tue, 13 March 2007 01:54 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Is that good enough ( without EXISTS):

SELECT :v_empno,
 CASE WHEN 1 = (SELECT 1 FROM emp WHERE id =:v_empno ) 
      THEN 'Yes' ELSE 'No' END
FROM DUAL;


HTH.
Michael


Re: need how to make of exists operator [message #224805 is a reply to message #224100] Thu, 15 March 2007 09:37 Go to previous message
frank.svs
Messages: 162
Registered: February 2006
Senior Member
Thank q
Previous Topic: Foreign key
Next Topic: Having Problem in using rownum, please help, Thanks
Goto Forum:
  


Current Time: Sat Dec 10 10:40:42 CST 2016

Total time taken to generate the page: 0.11115 seconds