Hi,
I am in SQL. Currently trying to collect some information about the SQL.
So I want some information about the SELECT - Command in SQL.
Anybody can please help me......:help:
Printable View
Hi,
I am in SQL. Currently trying to collect some information about the SQL.
So I want some information about the SELECT - Command in SQL.
Anybody can please help me......:help:
The SQL SELECT clause specifies the fields, constants, and expressions to display in the query results.
syntax for the SELECT clause is as follows:
The following code examples show many ways of retrieving data with the SQL SELECT command.Code:SELECT [ALL | DISTINCT] [TOP nExpr [PERCENT]] Select_List_Item [AS Column_Name] [, ...]
- SELECT customer.company FROM customer
- SELECT UPPER(city) AS CityList FROM customer
- SELECT country, postalcode, company FROM customer ORDER BY country
SQL is a fourth generation language designed for working with relational databases. SQL usually contains several dozen commands. The select command is the most important for most users. Its purpose is to retrieve data.
The basic form of the SQL select command:
Select columnlist
from tablelist
where conditions
group by grouplist
order by orderlist
Columnlist: The list of columns to appear in the output. To retrieve more than one column, separate the column names with commas. * (the asterisk) used as a column name means retrieve all columns.
Tablelist: The list of tables that participate in the query. Separate multiple table names with commas.
Conditions: Expressions that serve to limit the number of rows returned from a table, or to join rows from two or more tables.
Grouplist: If specified, SQL groups the rows in the output by columns in this list. Grouping is most often used with aggregating functions to produce summaries of data. SQL produces one row for each unique value found in the grouping column, and the function is calculated for all rows that belong to the group.
Orderlist: If specified, SQL sorts the output rows by the columns in this list. Example: order by state, city