Oracle 5.0 Reference Manual page 932

Table of Contents

Advertisement

[912]
POW(X,Y)
Returns the value of
mysql>
SELECT POW(2,2);
-> 4
mysql>
SELECT POW(2,-2);
-> 0.25
[912]
POWER(X,Y)
This is a synonym for
[912]
RADIANS(X)
Returns the argument X, converted from degrees to radians. (Note that π radians equals 180
degrees.)
mysql>
SELECT RADIANS(90);
-> 1.5707963267949
[912],
RAND()
RAND(N)
Returns a random floating-point value
is specified, it is used as the seed value, which produces a repeatable sequence of column values.
In the following example, note that the sequences of values produced by
places where it occurs.
mysql>
CREATE TABLE t (i INT);
Query OK, 0 rows affected (0.42 sec)
mysql>
INSERT INTO t VALUES(1),(2),(3);
Query OK, 3 rows affected (0.00 sec)
Records: 3
Duplicates: 0
mysql>
SELECT i, RAND() FROM t;
+------+------------------+
| i
| RAND()
+------+------------------+
|
1 | 0.61914388706828 |
|
2 | 0.93845168309142 |
|
3 | 0.83482678498591 |
+------+------------------+
3 rows in set (0.00 sec)
mysql>
SELECT i, RAND(3) FROM t;
+------+------------------+
| i
| RAND(3)
+------+------------------+
|
1 | 0.90576975597606 |
|
2 | 0.37307905813035 |
|
3 | 0.14808605345719 |
+------+------------------+
3 rows in set (0.00 sec)
mysql>
SELECT i, RAND() FROM t;
+------+------------------+
| i
| RAND()
+------+------------------+
|
1 | 0.35877890638893 |
|
2 | 0.28941420772058 |
|
3 | 0.37073435016976 |
+------+------------------+
3 rows in set (0.00 sec)
mysql>
SELECT i, RAND(3) FROM t;
+------+------------------+
| i
| RAND(3)
Mathematical Functions
raised to the power of Y.
X
[912].
POW()
[912]
in the range
v
Warnings: 0
|
|
|
|
912
<=
< 1.0. If a constant integer argument
0
v
RAND(3)
N
is the same both

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents