SQL Server Tutorial
SQL Server provides the SELECT statement to access and retrieve data from a database.
SELECT statement prompts the SQL Server to query a single table or multiple tables in the database.
SELECT [ALL | DISTINCT] column1, column2 ... columnN [INTO new_table_name] [FROM {table_name | view_name}, {table_name | view_name}...] [WHERE clause] [GROUB BY clause] [HAVING clause] [ORDER BY clause] [COMPUTE clause]
SELECT Statement is used to retrieve specific columns from the table.
SELECT column_name1 [, column_name2, ..] FROM table_name
SELECT column1[, column2, ...] FROM table_name
SELECT Id, Name, DeptId, Email FROM EmployeeOutput:
SELECT Id, Name, Head FROM DeaprtmentOutput:
SELECT * FROM EmployeeOutput:
SELECT * FROM DepartmentOutput:
SELECT statement result can be made more readable by including a string called a literal.
Literal can be specified using single quotes and it is printed in the SELECT Statement result as specified.
SELECT column_name | 'string literal'[, column_name | 'string literal', ..] FROM table_name
SELECT Id, Name, 'Department ID:', DeptId FROM EmployeeOutput:
SQL Server Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us | Report website issues in Github | Facebook page | Google+ page