Saturday, 23 January 2016

SQL SERVER Select Statement with Examples

SQL SERVER

SQL Server is a relational database technology developed by Microsoft.
In this tutorial I will try to elaborate with the basics of SQL Server such as how to retrieve and manipulate data. Then we will move to the more advanced topics such as how to create tables, functions, and procedures. 

SQL SERVER: SELECT STATEMENT

This SQL Server tutorial explains how to use the SELECT statement in SQL Server (Transact-SQL) with syntax and examples.

DESCRIPTION

The SQL Server (Transact-SQL) SELECT statement is used to retrieve records from one or more tables in a SQL Server database.

SYNTAX

SELECT expressions
FROM tables
[WHERE conditions];

EXAMPLE

1. SELECT ALL RECORDS FROM SINGLE TABLE


SELECT *
FROM Employees
WHERE Salary> 10000
ORDER BY Employee_ID ASC;
In this SQL Server SELECT statement example, we've used * to signify that we wish to select all fields from the Employee table where the salary is greater than 10000. The result set is sorted by Employee_ID in ascending order.

2. SELECT INdividuAL RECORDS FROM SINGLE TABLE



SELECT Employee_Name,Employee_Salary,Employee_Designation
FROM Employees
WHERE Salary> 10000 and Employee_Designation='Developer'
ORDER BY Employee_ID ASC;

No comments:

Post a Comment

Join US Our Community
×