Home    Back    Forward    Refresh    txtSQL Homepage

SELECT Syntax
txtSQL >= 3.0.0 Beta

SELECT( * | [column1, column2...[ AS alias...]])
          [ DISTINCT column]

FROM (db.table|table)
          [ WHERE WhereClause
          [ LIMIT LimitClause
          [ ORDERBY OrderByClause]]]

The SELECT statement will retrieve data that matches the WHERE clause; if no WHERE clause is given, all rows match, and thus, all will be returned. In order to select only certain columns, specify the respective columns right after the 'SELECT' (For example: SELECT id, name, adress ...).

You may also specify column aliases after the column name when selecting ("SELECT id as IDENT, name AS NAME"). Also, instead of column names, you may also select string literals or computations, although a bit limited in it's capability (For example: "SELECT id, 'some random text' as RANDOM, eval(1+1) as TWO")

The search will take place inside the selected database, unless you specify a database along with the table after the 'FROM' part (For Example: SELECT * FROM db.table). Furthermore, only the rows that fall into the LIMIT will be returned.

If an ORDERBY statement is given, then the results will be sorted according to the orderby clause. Please make note that this operation is expensive on larger SELECT's in terms of timing and should be used sparingly. If a DISTINCT statement is given for a column, then all rows that contain a duplicate of that respective column will NOT be returned.

NOTE- To have a complete look at the SELECT function, and any changes to its functionality, see the select() function.


User Comments - SELECT Syntax
No comments posted yet;
Last Page Next Page

'Language Reference'

User Functions

Database Functions

Data Manipulation Functions

Table Functions

Error Handling Functions

SQL Syntax
  • SELECT Syntax
  • INSERT Syntax
  • DELETE syntax
  • UPDATE Syntax
  • CREATE DATABASE Syntax
  • DROP DATABASE Syntax
  • SHOW DATABASES Syntax
  • USE Syntax
  • LOCK Syntax
  • UNLOCK Syntax
  • IS LOCKED Syntax
  • CREATE TABLE Syntax
  • DROP TABLE Syntax
  • SHOW TABLES Syntax
  • DESCRIBE Syntax
  • SHOW USERS Syntax
  • GRANT PERMISSIONS Syntax
  • Column Properties
  • Column Types
  • LIMIT Syntax
  • ORDERBY Syntax
  • WHERE Syntax

  • [ txtSQL Documentation powered by txtSQL | 6 SQL Queries ]