Following is the sql query (oracle) that I use to get the last record of the returning result of the select query. Is this the optimum way?
SELECT HAZMAT_PLACARD_NOTATION
INTO v_pcn
FROM HAZMAT_CLASS_IRF
WHERE HAZMAT_CD = p_stcc_cd and ROWID = (SELECT MAX(ROWID) FROM HAZMAT_CLASS_IRF WHERE HAZMAT_CD = p_stcc_cd);
Following is an example result set of the select query where HAZMAT_CD = 4920111 But the last row with the HAZMAT_PLAYCARD_NOTATION value SPONTANEOUSLY COMBUSTIBLE should be retrieved. That's the objective