LOG10(X) returns the base-10 logarithm of X. Nonpositive inputs return NULL with a warning.
SELECT LOG10(3); -- Output: 0.477121254719662
SELECT LOG10(100); -- Output: 2
SELECT LOG10(0); -- Output: NULL
SELECT ROUND(LOG10(2), 2); -- Output: 0.30
SELECT ROUND(LOG10(-5), 2); -- Output: NULL
SELECT ROUND(LOG10(9), 2); -- Output: 0.95
SELECT LOG10(X);
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.