I need to only retrieve the last record when this Oracle 9.2 query executes.
DI 2016-09-26 168398 063848979 //SRC RMS
I would also like another Oracle query that only retrieves the first record.
NULL DI 2016-09-16 174261 063848979 //SRC RMS FB BRAMPTON TO
Right now, the query will retrieve 3 records for this problem when it executes.
The 1993237 will be a field once I get it to work.
This Oracle query executes inside a SQL query.
SELECT (CASE WHEN TO_CHAR(aa.NOTES) IS NOT NULL THEN TO_CHAR(aa.NOTES) ELSE TO_CHAR(a.PTEXT) END) as MyNote
FROM GPCOMP1.GPPROB a, GPCOMP1.GPPROBNOTES aa
WHERE a.PROBLEM_ID = aa.PROB_ID AND (a.PROBLEM_ID = 1993237)
ORDER BY a.MODIFIED_ON DESC