I'm having a problem getting Oracle to return the latest X rows in a table (i.e. in this case it would be returning our newest orders).
$stid = oci_parse($conn, "
SELECT OrderNo, InvoiceNo
FROM Orders
WHERE ROWNUM <= 5
ORDER BY ROWNUM DESC
");
Reading this makes sense in that the highest row numbers should be first and it should show the first five. What am I doing wrong here?