The SQL SELECT statement returns a result set of records from one or more tables.
Welcome to CWAnswers
CWAnswers is your guide to the sprawling world wide web. The directory aims to provide a useful guide made by users. You can share your knowledge as well - simply sign up and edit your first entry. For questions just contact the team at support - at - cwanswers.com.
Weblinks for Select
Top 10 for Select
Things about Select you find nowhere else.
Select content modules
The Florida Jury Selection Blog - Voir Dire - Jury Selection
Litigation issues discussed by attorney Bob Kelley. ... The section of The Florida Jury Selection blog dealing with juror pay has been ...www.juryblog.com/IBCA Select Girls Basketball
Blog Archive. 2008 (62) December (1) Coach Adam DeJoode's 100th win. November (2) ... photo gallery of the IBCA Select Red vs Northern L...ibcaselect.blogspot.com/Statutes " The Florida Jury Selection Blog - Voir Dire - Jury Selection
... to The Florida Jury Selection Blog and receive instant notification of ... Florida Jury Selection Blog - Florida Voir Dire Selection - Florida - Voir Dire ...www.juryblog.com/statutes/Select Editions
Behind the scenes with the Select Editions editorial team ... the blog lately, so I thought, well, maybe I could have someone else do the job for me. ...selecteditions.blogspot.com/Dubai Property, Dubai Real Estate, Dubai Select
Dubai Select is a blog that encourages comment on events and news that impact on the interests ... 2004. April 2004. November 2003 © 2009 - Dubai Select Blog ...www.dubaiselect.com/The SQL SELECT statement returns a result set of records from one or more tables.
It retrieves zero or more rows from one or more base tables, temporary tables, or views in a database. In most applications, SELECT is the most commonly used Data Manipulation Language (DML) command. As SQL is a non-procedural language, SELECT queries specify a result set, but do not specify how to calculate it: translating the query into an executable "query plan" is left to the database system, more specifically to the query optimiser.
The SELECT statement has many optional clauses:
WHEREspecifies which rows to retrieve.GROUP BYgroups rows sharing a property so that an aggregate function can be applied to each group.HAVINGselects among the groups defined by the GROUP BY clause.ORDER BYspecifies an order in which to return the rows.
||SELECT * FROM T;
|align="center"|
|- |align="center"|
||SELECT C1 FROM T;
|align="center"|
|- |align="center"|
||SELECT * FROM T WHERE C1 = 1;
|align="center"|
|- |align="center"|
||SELECT * FROM T ORDER BY C1 DESC;
|align="center"|
|}
Given a table T, the query SELECT * FROM T will result in all the elements of all the rows of the table being shown.
With the same table, the query SELECT C1 FROM T will result in the elements from the column C1 of all the rows of the table being shown. This is similar to a projection in Relational algebra, except that in the general case, the result may contain duplicate rows. This is also known as a Vertical Partition in some database terms, restricting query output to view only specified fields or columns.
With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown — in Relational algebra terms, a selection will be performed, because of the WHERE clause. This is also known as a Horizontal Partition, restricting rows output by a query according to specified conditions.
Limiting result rows
Often it is convenient to indicate a maximum number of rows that are returned. This can be used for testing or to prevent consuming excessive resources if the query returns more information than expected. The approach to do this often varies per vendor.
In ISO SQL:2003, result sets may be limited by using
- cursors, or
- By introducing SQL window function to the SELECT-statement
ROW_NUMBER() window function
ROW_NUMBER() OVER may be used for a simple limit on the returned rows. E.g., to return no more than ten rows:
) AS foo WHERE row_number <= 10
























