Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> min date

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: min date
 will23235  Posted: Jun 13, 2007 09:45:46 AM

 Total Post: 1
 Joined: Jun, 2007






 I need compare the values in a case statement against a subquery

Here is the subquery in the select clause
(SELECT MIN(pr2.datecompleted)
FROM Alpha pr2
WHERE api.jobid = pr2.jobid)

and i need to use a case statement to compare dates and the problem that
i am experiencing is referencing the result set from the subquery.

 Nehru
Posted: Jul 27, 2007 06:17:29 AM  

 Total Post: 46
 Joined: Jul, 2007






 
Hi,

We can use MIN(<date column>) and also it can use in CASE stmt also

Better post clearly what you need

I am giving one example

SELECT CASE WHEN E.HIREDATE BETWEEN '10-JAN-1981' AND '14-FEB-1982'
THEN 'Older'
ELSE 'Younger' END
FROM EMP E,DEPT D
WHERE E.DEPTNO = D.DEPTNO;

AND ALSO WITH 'MIN' FUNCTION

SELECT CASE WHEN MIN(E.HIREDATE) BETWEEN '10-JAN-1981' AND '14-FEB-1982'
THEN 'Older'
ELSE 'Younger' END
FROM EMP E,DEPT D
WHERE E.DEPTNO = D.DEPTNO;

"FOR BETTER REPLY, BETTER POST IS NEED"

FRIENDS LET ME KNOW IS THERE ANY WRONG

THANKS FRNDS
TAKE CARE
BYE
NEHRU


 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi327
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software