I try to simplify below subqueries to improve select statement. I have table with 3 basic columns as ID, GRAGE and AGE. To select all records which have GRADE same as GRADE of Maximum ID Might somebody have better way that create nested subqueries, welcome all your suggestions?
Note: My apologise for formatting the table
ID GRADE AGE
10 A 30
12 B 45
13 A 15
09 B 14
20 A 12
SELECT
*
FROM
TABLE
WHERE
GRADE = (
SELECT
grade
FROM
TABLE
WHERE
id = (SELECT MAX(id) FROM TABLE)
);
EXPLAIN PLAN FOR your_query, thenSELECT * FROM table( DBMS_XPLAN.Display ), and finally copy a result of the latter query as a text - not a bitmap and append it to the question.