What do you want to save?
Add Code snippet
New code examples
-
SQL 2022-03-17 15:40:29
mysql limit rows
-- MySql SELECT * FROM emp ORDER BY sal DESC LIMIT 5; -- SQL Server SELECT TOP 5 * FROM emp ORDER BY sal DESC; -- Oracle < 11g SELECT * FROM ( SELECT * FROM emp ORDER BY sal DESC ) WHERE ROWNUM <= 5; -- Oracle 12c + SELECT * FROM emp ORDER BY sa... Add solution -
SQL 2022-02-01 04:35:17
sql finding longest and shortest names in a fleld
# IN the example below, "CITY" is the filed, "STATION" is the Table (SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY) ASC, CITY ASC LIMIT 1) UNION (SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY) DESC, CITY DE... Add solution -
SQL 2021-11-21 07:34:17
sql limit results returned
-- MySql SELECT * FROM emp ORDER BY sal DESC LIMIT 5; -- SQL Server SELECT TOP 5 * FROM emp ORDER BY sal DESC; -- Oracle < 11g SELECT * FROM ( SELECT * FROM emp ORDER BY sal DESC ) WHERE ROWNUM <= 5; -- Oracle 12c + SELECT * FROM emp ORDER BY sa... Add solution -
SQL 2021-11-08 22:25:18
sql limit results
-- MySql SELECT * FROM emp ORDER BY sal DESC LIMIT 5; -- SQL Server SELECT TOP 5 * FROM emp ORDER BY sal DESC; -- Oracle < 11g SELECT * FROM ( SELECT * FROM emp ORDER BY sal DESC ) WHERE ROWNUM <= 5; -- Oracle 12c + SELECT * FROM emp ORDER BY sa... Add solution
Best helpers
Ranking is empty