COT(value) : COT « Math « SQL / MySQL






COT(value)

   
mysql>
mysql> CREATE TABLE Test
    -> (
    ->     TestID SMALLINT NOT NULL PRIMARY KEY,
    ->     Amount SMALLINT NOT NULL
    -> );
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO Test VALUES
    -> (101, 12),
    -> (102, 1),
    -> (103, 139),
    -> (104, -37),
    -> (105, 0),
    -> (106, -16);
Query OK, 6 rows affected (0.00 sec)
Records: 6  Duplicates: 0  Warnings: 0

mysql>
mysql> SELECT TestID, Amount, COT(Amount) AS Cotangent
    -> FROM Test
    -> ORDER BY TestID;
+--------+--------+-------------------+
| TestID | Amount | Cotangent         |
+--------+--------+-------------------+
|    101 |     12 | -1.57267340639769 |
|    102 |      1 | 0.642092615934331 |
|    103 |    139 |  1.03143886630872 |
|    104 |    -37 |  1.18938414411059 |
|    105 |      0 |              NULL |
|    106 |    -16 | -3.32632319563545 |
+--------+--------+-------------------+
6 rows in set (0.00 sec)

mysql>
mysql> drop table Test;
Query OK, 0 rows affected (0.00 sec)

   
    
    
  








Related examples in the same category

1.Use COT
2.Use the COT() function to determine the cotangent of a number: COT()