fixed unsupported text formatting within <code> tags (for SQL statements)
This commit is contained in:
parent
876973a8cb
commit
cc85ccca1a
@ -1,6 +1,6 @@
|
|||||||
Syntax:
|
Syntax:
|
||||||
<code>
|
<code>
|
||||||
//operand// [NOT ]EXISTS (//subquery//)
|
<operand> [NOT ]EXISTS (<subquery>)
|
||||||
</code>
|
</code>
|
||||||
The EXISTS operator returns TRUE if the subquery returns one or more rows and FALSE otherwise.
|
The EXISTS operator returns TRUE if the subquery returns one or more rows and FALSE otherwise.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Syntax:
|
Syntax:
|
||||||
<code>
|
<code>
|
||||||
//operand// IN (//subquery//|//value list//)
|
<operand> IN (<subquery>|<value list>)
|
||||||
</code>
|
</code>
|
||||||
An IN conditional expression returns true if the //operand// is found from result of the //subquery//
|
An IN conditional expression returns true if the //operand// is found from result of the //subquery//
|
||||||
or if its in the specificied comma separated //value list//, hence the IN expression is always false if the result of the subquery
|
or if its in the specificied comma separated //value list//, hence the IN expression is always false if the result of the subquery
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<code>
|
<code>
|
||||||
DELETE FROM //component_name//
|
DELETE FROM <component_name>
|
||||||
[WHERE //where_condition//]
|
[WHERE <where_condition>]
|
||||||
[ORDER BY ...]
|
[ORDER BY ...]
|
||||||
[LIMIT //record_count//]
|
[LIMIT <record_count>]
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
* The DELETE statement deletes records from //component_name// and returns the number of records deleted.
|
* The DELETE statement deletes records from //component_name// and returns the number of records deleted.
|
||||||
@ -12,7 +12,7 @@ Without WHERE clause, all records are deleted.
|
|||||||
|
|
||||||
* If the ORDER BY clause is specified, the records are deleted in the order that is specified.
|
* If the ORDER BY clause is specified, the records are deleted in the order that is specified.
|
||||||
|
|
||||||
* The LIMIT clause places a limit on the number of rows that can be deleted.
|
* The LIMIT clause places a limit on the number of rows that can be deleted.
|
||||||
The statement will stop as soon as it has deleted //record_count// records.
|
The statement will stop as soon as it has deleted //record_count// records.
|
||||||
|
|
||||||
|
|
||||||
@ -30,6 +30,6 @@ $rows = $q->delete('Account')
|
|||||||
->from('Account a')
|
->from('Account a')
|
||||||
->where('a.id > ?', 3)
|
->where('a.id > ?', 3)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
print $rows; // the number of affected rows
|
print $rows; // the number of affected rows
|
||||||
</code>
|
</code>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Syntax:
|
Syntax:
|
||||||
|
|
||||||
|
|
||||||
<code>
|
<code>
|
||||||
FROM //component_reference// [[LEFT | INNER] JOIN //component_reference//] ...
|
FROM <component_reference> [[LEFT | INNER] JOIN <component_reference>] ...
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
The FROM clause indicates the component or components from which to retrieve records.
|
The FROM clause indicates the component or components from which to retrieve records.
|
||||||
@ -18,7 +18,7 @@ For each table specified, you can optionally specify an alias.
|
|||||||
SELECT u.*, p.* FROM User u LEFT JOIN u.Phonenumber
|
SELECT u.*, p.* FROM User u LEFT JOIN u.Phonenumber
|
||||||
|
|
||||||
SELECT u.*, p.* FROM User u, u.Phonenumber p
|
SELECT u.*, p.* FROM User u, u.Phonenumber p
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
* //INNER JOIN// produces an intersection between two specified components (that is, each and every record in the first component is joined to each and every record in the second component).
|
* //INNER JOIN// produces an intersection between two specified components (that is, each and every record in the first component is joined to each and every record in the second component).
|
||||||
So basically //INNER JOIN// can be used when you want to efficiently fetch for example all users which have one or more phonenumbers.
|
So basically //INNER JOIN// can be used when you want to efficiently fetch for example all users which have one or more phonenumbers.
|
||||||
|
@ -2,15 +2,15 @@ SELECT statement syntax:
|
|||||||
<code>
|
<code>
|
||||||
SELECT
|
SELECT
|
||||||
[ALL | DISTINCT]
|
[ALL | DISTINCT]
|
||||||
//select_expr//, ...
|
<select_expr>, ...
|
||||||
[FROM //components//
|
[FROM <components>
|
||||||
[WHERE //where_condition//]
|
[WHERE <where_condition>]
|
||||||
[GROUP BY //groupby_expr//
|
[GROUP BY <groupby_expr>
|
||||||
[ASC | DESC], ... ]
|
[ASC | DESC], ... ]
|
||||||
[HAVING //where_condition//]
|
[HAVING <where_condition>]
|
||||||
[ORDER BY //orderby_expr//
|
[ORDER BY <orderby_expr>
|
||||||
[ASC | DESC], ...]
|
[ASC | DESC], ...]
|
||||||
[LIMIT //row_count// OFFSET //offset//}]
|
[LIMIT <row_count> OFFSET <offset>}]
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ The SELECT statement is used for the retrieval of data from one or more componen
|
|||||||
SELECT a.name, a.amount FROM Account a
|
SELECT a.name, a.amount FROM Account a
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
* An asterisk can be used for selecting all columns from given component. Even when using an asterisk the executed sql queries never actually use it
|
* An asterisk can be used for selecting all columns from given component. Even when using an asterisk the executed sql queries never actually use it
|
||||||
(Doctrine converts asterisk to appropriate column names, hence leading to better performance on some databases).
|
(Doctrine converts asterisk to appropriate column names, hence leading to better performance on some databases).
|
||||||
<code>
|
<code>
|
||||||
SELECT a.* FROM Account a
|
SELECT a.* FROM Account a
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
Syntax:
|
Syntax:
|
||||||
<code>
|
<code>
|
||||||
WHERE //where_condition//
|
WHERE <where_condition>
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
* The WHERE clause, if given, indicates the condition or conditions that the records must satisfy to be selected.
|
* The WHERE clause, if given, indicates the condition or conditions that the records must satisfy to be selected.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* //where_condition// is an expression that evaluates to true for each row to be selected.
|
* //where_condition// is an expression that evaluates to true for each row to be selected.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user