ROW_NUMBER() OVER function can be used as a function to limit rows by specifying no of rows to view.
SELECT * FROM
( SELECT
ROW_NUMBER() OVER (ORDER BY sort_key ASC) AS row_number,
COLUMNS
FROM tablename
) A(name of select statement)
WHERE row_number <= 10
Labels
- AVG() Function (1)
- Aggregate Functions (1)
- Candidate Key (1)
- Composite and Compound Keys (1)
- EXISTS (1)
- FIRST() Function (1)
- Group By Statement (1)
- Having Clause (1)
- INSERT (1)
- LIKE (1)
- SELECT AS CLAUSE (1)
- SQL Distinct Unique Records (1)
- SQL IN (1)
- SQL Joins (1)
- SQL Last() Function (1)
- SQL NULL Conditional (1)
- SQL Not Exists (1)
- SQLComparison Operators (1)
- Sql Max() Function (1)
- Sql Min() Function (1)
- Sql SUM() Function (1)
- WHERE (1)
Blog Archive
-
▼
2010
(73)
-
▼
March
(7)
- ROW_NUMBER() window function
- Select statement to Extract text file in a column ...
- Select Column Level Fields from more than one table
- How to Choose Date Format in MYSQL
- Single Insertion for all values in ETL script
- Hour Basis Records from Transactional Databases to...
- Setting and Getting varibles in Pentaho Transforma...
-
▼
March
(7)
Friday, March 26, 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment