How to Return Subset of Rows in SQL
In this article I am going to explain how to return a subset of selected rows in SQL.
In this article I am going to explain about how to return a subset of selected rows in SQL. When you use select statement it shows all data in result set. There are many situation when you need only a subset of selected rows. To fetch a subset of selected rows we use TOP clause fallowed by integer value. We can also use PERCENT clause to fetch n percent rows in result set. Notice that statement must have ORDER BY clause.
A Statement that create mcnemp table
Statements that insert data in mcnemp table
A Statement that is used to fetch data from mcnemp table
A SELECT Statement with a TOP clause
A SELECT Statement with TOP clause and PERCENT keyword