SELECT ROUND(TAN(PI()),2); // Output is -0.00
SELECT TAN(PI()/2); // Output is 1.6331239e+16 or infinity
SELECT ROUND(TAN(PI()/3),2); // Output is 1.73
We used ROUND() to show only two decimal places.
SELECT TAN( X )
X is in Radian Radians function convert degree value to radian.
SELECT TAN(RADIANS(0)); // Output is 0 SELECT TAN(RADIANS(45)); // Output is 1 SELECT TAN(RADIANS(90)); // Output is infinity or 1.63312393531954e+016 SELECT ROUND(TAN(RADIANS(180)),2); // Output is -0.00SQL Math References COT() Average value Query
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.