Both sides previous revisionPrevious revisionNext revision | Previous revision |
spec [2012/03/08 17:16] – [Syntax of FwSQL] wuyw | spec [2012/03/10 15:08] (current) – old revision restored wuyw |
---|
- Select | - Select |
| |
*SELECT [DISTINCT] //select-expr//,...\\ [FROM //tbl-ref//[,//tbl-ref//]...]\\ [WHERE //where-condition//]\\ [GROUP BY //col-name//]\\ [HAVING //having-condition//]\\ [ORDERE BY col-name[ ASC | DESC ],...] | *SELECT [DISTINCT] //select-expr//,...\\ [FROM //tbl-ref//[,//tbl-ref//]...]\\ [WHERE //where-condition//]\\ [GROUP BY //col-name//]\\ [HAVING //having-condition//]\\ [ORDER BY col-name[ ASC | DESC ],...] |
*//select-expr// ::=//value// [AS //alias//]|* | *//select-expr// ::=//value// [AS //alias//]|* |
*//func// ::= AVG | COUNT | MIN | MAX | SUM | *//func// ::= AVG | COUNT | MIN | MAX | SUM |
*//where-condition//::=//bool-expr// | *//where-condition//::=//bool-expr// |
*//bool-expr// ::=//value cop value// \\ | //bool-expr// AND //bool-expr// \\ | //bool-expr// OR //bool-expr// \\ | [NOT] EXISTS (//subquery//)\\ | //value cop// ANY (//subquery//) \\ | //value// IN (//subquery//) \\ | //value cop// ALL (//subquery//) \\ | (//bool-expr//) | *//bool-expr// ::=//value cop value// \\ | //bool-expr// AND //bool-expr// \\ | //bool-expr// OR //bool-expr// \\ | [NOT] EXISTS (//subquery//)\\ | //value cop// ANY (//subquery//) \\ | //value// IN (//subquery//) \\ | //value cop// ALL (//subquery//) \\ | (//bool-expr//) |
*//cop// ::= < | > | = | <= | >= | <> | *//cop// ::= < | > | = | ''''<''='' | >= | <> |
*//value// ::= (//value//)|//col-name//|//const-value//|//value aop value// \\ | (subquery with only one elements(or NULL)in the result table)\\ | //func//(//col-name//) | *//value// ::= (//value//)|//col-name//|//const-value//|//value aop value// \\ | (subquery with only one elements(or NULL)in the result table)\\ | //func//(//col-name//) |
*//aop// ::= + | - | * | / | % | *//aop// ::= + | - | * | / | % |