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.
|
|
|
|
| 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 |
Send this thread to your friend |
|
|
|
|
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 Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 327 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|