1. Oracle Database
SELECT * from TABLENAME WHERE ROWNUM <= N
2. Infomix Database
SELECT First N * from TABLENAME
3. DB2 Database
SELECT *
From (SELECT * row_number () + ({ORDER by COL1 DESC}) as ROWNUM from TABLENAME)
WHERE ROWNUM <= N
Or
SELECT COLUMN from TABLENAME FETCH first N ROWS only
4. SQL Server Database
SELECT TOP N * from TABLENAME
5. Sybase database
SET ROWCOUNT N
GO
SELECT * from TABLENAME
6. mysql Database
SELECT * from TABLENAME LIMIT N
2 DB2
Select column from [TableName] where [query condition] FETCH first all rows only
3 MySQL
SELECT * FROM [tableName] where [query condition] limit 10
4 SQL Server
4.1 Read the first 10 strips
Select Top (Ten) * from [tableName] where [query condition]
4.2 After reading 10 strips
Select Top * FROM [TableName] ORDER by id DESC
4.3 According to a sort, 5th to 10th of these records
Select Top 6 * from [tableName] where ID not in (select top 4 ID from [TableName])
5 Oracle
SELECT * FROM [TableName] where rownum<=10
Oracle queries data for rows 10th through 100th
SELECT * FROM (select T.*,rownum as RN from table_name T) where RN between and 100;
1. Is the value of the field in the Oracle lookup table empty?
SELECT * FROM table_name where field name is (not) null;
2. Find whether a field in a table is a value
SELECT * FROM table_name where field name = ' field value ';
3. Change the original value of the field in the table to a new value
Update table_name SET Field name = ' new field value ' where field name = ' Old field value '
Data SQL for the first n rows of each database query