MySQL RADIANS function is one of the Numeric Function which will convert the degree values into radians. In this article we will show you, How to find the radians value in MySQL using Command Prompt, and Workbench with example.
MySQL RADIANS Syntax
The basic syntax of the RADIANS in MySQL is as shown below:
SELECT RADIANS (Numeric_Expression) FROM Source
To demonstrate this RADIANS Numeric function, we are going to use the below shown data
MySQL RADIANS Example 1
The MySQL RADIANS Function is used to convert the degree value into radians. The following query will show multiple ways to use RADIANS function.
-- MySQL RADIANS Function Example -- Finding Radians Value for Negative Value SELECT RADIANS(-620.75) AS `Value in Radians`; -- Finding Radians Value for Positive Value SELECT RADIANS(180.00) AS `Value in Radians`; -- Finding Radians Value for string value SELECT RADIANS('90.00') AS `Value in Radians`; -- Finding Radians Value of a String SELECT RADIANS('MySQL') AS `Value in Radians`;
From the below screenshot you can see, we used MySQL RADIANS function on different values. Here, we assigned a new name to the result as ‘Value in Radians’ using ALIAS Column.
MySQL RADIANS Example 2
In MySQL, RADIANS Numeric Function also allows you to find the radians value for the column data. In this example, we are going to find the equivalent radians value for all the records present in Standard Cost, and Sales column.
-- MySQL RADIANS Example USE mysqltutorial; SELECT Product, Color, StandardCost, RADIANS(StandardCost) AS `Cost in Radians`, Sales, RADIANS(Sales) AS `Sales in Radians`, TaxAmt FROM `numeric functions`;
Thank You for Visiting Our Blog