Written By:- Isha Malhotra
Our Website:-Tech Altum
Use of percent(%) in Top command in SQL Server
Our Website:-Tech Altum
Use of percent(%) in Top command in SQL Server
In my last article I discussed about the
top command. In this article I am showing how to use percent with top command.
I am taking the table same as I used in my last article.
Use of percent in Top command
If I
Want to select 2 rows from the top then I will write the following query:-
select top 2 * from prod_rep
But we can also select
Data in percentage (%) using top command. Using percentage it will show the row
Accordingly. For example if table contains 4 rows and I select 50% then it will
Show 2 rows.
