Use COT
/* mysql> select COT( 0.3); +-----------------+ | COT( 0.3) | +-----------------+ | 3.2327281437658 | +-----------------+ 1 row in set (0.00 sec) */ select COT( 0.3);