Difference between revisions of "SQL Numeric operators"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Numeric operators | Numeric operators | ||
Line 43: | Line 36: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | SELECT name, address, balance, cost*1.15; | |
− | SELECT name, address, balance, cost*1.15 | + | FROM accounts; |
− | FROM accounts | + | WHERE paid_date < date() AND ord_value > 10000; |
− | WHERE paid_date < date() AND ord_value > 10000 | + | ORDER BY name, paid_date |
− | ORDER BY name, paid_date | + | |
− | + | SELECT account_no, ord_value – paid_value as "Outstanding Balance"; | |
− | SELECT account_no, ord_value – paid_value as "Outstanding Balance" | + | FROM accounts; |
− | FROM accounts | + | ORDER BY account_no |
− | ORDER BY account_no | + | |
</code> | </code> | ||
==Products== | ==Products== | ||
− | Recital | + | Recital, Recital Server |
[[Category:Documentation]] | [[Category:Documentation]] | ||
− | [[Category:SQL | + | [[Category:SQL|Operators,Numeric]] |
− | + |
Latest revision as of 15:49, 5 July 2011
Purpose
Numeric operators
Syntax
<expression1> operator <expression2>[ operator <expression3>…]
See Also
INSERT, OPERATORS, SELECT, UPDATE
Description
Operators used with Numeric expressions:
Operator | Operation |
---|---|
** | Exponentiation |
* | Multiplication |
/ | Division |
% | Modulus/Remainder |
+ | Addition |
- | Subtraction |
Example
SELECT name, address, balance, cost*1.15; FROM accounts; WHERE paid_date < date() AND ord_value > 10000; ORDER BY name, paid_date SELECT account_no, ord_value – paid_value as "Outstanding Balance"; FROM accounts; ORDER BY account_no
Products
Recital, Recital Server