October 2002
Beginner
864 pages
18h 41m
English
Many of the uses you have for the data you retrieve involve mathematics. Most implementations of SQL provide arithmetic functions similar to the functions covered here. The examples in this section use the NUMBERS table:
SQL> SELECT * 2 FROM NUMBERS; A B --------- --------- 3.1415 4 -45 .707 5 9 -57.667 42 15 55 -7.2 5.3 6 rows selected.
The MySQL equivalent is
mysql> select * from numbers; +----------+---------+ | a | b | +----------+---------+ | 3.1415 | 4.0000 | | -45.0000 | 0.7070 | | 5.0000 | 9.0000 | | -57.6670 | 42.0000 | | 15.0000 | 55.0000 | | -7.2000 | 5.3000 | +----------+---------+ 6 rows in set (0.39 sec)
The ABS function returns the absolute value of the number you point to—for example, ...
Read now
Unlock full access