Name

OCT( )

Synopsis

OCT(number)

This function returns the octal or base 8 numeric system value of the given number. It returns NULL if the argument is NULL.

SELECT OCT(1), OCT(9), OCT(16);
+--------+--------+---------+
| OCT(8) | OCT(9) | OCT(16) |
+--------+--------+---------+
| 10     | 11     | 20      |
+--------+--------+---------+

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.