Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle select first result

SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
    WHERE ROWNUM = 1;
-- Oracle 12c:
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC) 
    FETCH FIRST 1 ROW ONLY;
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC) 
    FETCH FIRST 10 ROW ONLY;
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC) 
    FETCH FIRST 10 ROWS ONLY;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql case 
Sql :: how to show index type in postgresql 
Sql :: oracle remove line breaks 
Sql :: CALCULATING MONTHS BETWEEN TWO DATES IN POSTGRESQL 
Sql :: how to make a select in sql 
Sql :: postgresql size of database 
Sql :: sql server select first day of previous year 
Sql :: sql create view 
Sql :: sql server insert into select 
Sql :: modify column name in sql 
Sql :: events mysql 
Sql :: mysql backup table 
Sql :: sql table 
Sql :: oracle apex warn on unsaved changes 
Sql :: how to select one row in mysql 
Sql :: delete ids between sql 
Sql :: SQL Error 1040 : Too many connections 
Sql :: mysql check if lowercase 
Sql :: mssql check if date is greater than today 
Sql :: sql running total 
Sql :: oracle drop job if exists 
Sql :: Add a column with a default value to an existing table in SQL Server 
Sql :: sql query for getting data with join and count 
Sql :: sql reverse order of results 
Sql :: current date in sql 
Sql :: Converting mysql tables to charset utf8mb4 
Sql :: change password postgres pgserver 
Sql :: sql convert date format 
Sql :: sqlserver add column 
Sql :: how to delete a table in mysql 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =