Specify the number of records to be retrieved as a percentage
If you want to get the "top N" among the number of records to be fetched, you can use the "TOP clause", but you can also get this number as a percentage. TO GET BY A PERCENTAGE, USE "TOP - PERCENT".
An example of selecting a table with 10,000 records. If you do not use the TOP clause, 10,000 records are retrieved.
select * from [TST_Tag01]
The following example retrieves the number specified in the TOP clause.
select top 200 * from [TST_Tag01]
The following example retrieves the number of counts specified by PERCENT in the TOP clause. If you specify 40, you are getting 40% of the records.
select top (40) percent * from [TST_Tag01]
PERCENT can also contain decimal numbers.
select top (3.5) percent * from [TST_Tag01]
The number that can be specified for PERCENT can be 0 ~ 100.
Also, if you use PERCENT, enclose the number in parentheses "()". This is for compatibility reasons, but be sure to use parentheses because not enclosing them in parentheses may result in errors.