Hi Ratnam,
Sample mainly for getting samples of row from table or view. We can use SAMPLE n, where n is an integer or can be decimal between 1.00 and 0.00. We can also use SAMPLEID.
TOP n operator shows number of rows or percentage of rows from result set.
eg : SELECT TOP 10 PERCENT * FROM employee;
You may use Qualify ..row_number() too to restrict rows.
Cheers,
Raja
Hi Ratnam,
Sample mainly for getting samples of row from table or view. We can use SAMPLE n, where n is an integer or can be decimal between 1.00 and 0.00. We can also use SAMPLEID.
TOP n operator shows number of rows or percentage of rows from result set.
eg : SELECT TOP 10 PERCENT * FROM employee;
You may use Qualify ..row_number() too to restrict rows.
Cheers,
Raja