Sunday, 20 November 2011

Explain the TOP clause in SQL Server.

The TOP clause is used to display the number of records to return. This clause is useful to return records from large tables.
Ex :
Select Top 5 * from Employees
This Query will display the only the first five records from the Employees.
Ex :
Select Top 25 percent * from Employees
This Query will display the 25% of the records from the table.

Labels:


Bookmark this Blog in your Favorites

Wednesday, 16 November 2011

Explain ROUND () function in SQL Server.

The ROUND () function is used for rounding the numeric value to the number of decimals required.

Ex :
Select EmployeeName, round (EmployeeReimbursement, 0)

as EmployeeReimbursement

from Employees

This Query will display the Employee Name and the Employee Reimbursement rounded to the nearest integer.

Labels:


Bookmark this Blog in your Favorites