SQL TOP PERCENT Example

The following SQL statement selects the first 50% of the records from the "Customers" table:

Example

SELECT TOP 50 PERCENT * FROM Customers;


The following SQL statement shows the equivalent example using ROWNUM:

Example

SELECT * FROM Customers

WHERE ROWNUM <= 3;


The following SQL statement shows the equivalent example using the LIMIT clause:

Example

SELECT * FROM Customers

LIMIT 3; 


Neela Balar

Neela Balar Creator

I am computer engineer

Suggested Creators

Neela Balar