SQL select roq code example
Example 1: sql select first row
-- NOTE: This is for Oracle/PLSQL only
-- > EXAMPLE
select *
from CONSUMERS
where ROWNUM <= 1
/*
-- > SYNTAX
select *
from {yourTable}
where ROWNUM <= {number-of-rows}
*/
Example 2: rownum in sql
SELECT ROWNUM, a.*
FROM (SELECT customers.*
FROM customers
WHERE customer_id > 4500
ORDER BY last_name) a;