PI
PI is an SQL function that returns the value of (Pi), which is the mathematical constant with approximate value of 3.14159. It doesn't require any parameters.
PI()
Example
Output
Explanation
The “PI()” statement in MySQL is a mathematical function that returns the value of PI up to the decimal precision supported by the system, which is approximated to 3.141593. No arguments are needed for this function.
PI()
Example
Output
Explanation
In this example, the PI()
function is used, which returns the constant value of PI. In SQL Server, PI is calculated to a value of approximately 3.141592653589793.
PI()
Example
Output
Explanation
In Oracle SQL, the PI()
function returns the value of Pi (approximately 3.14159). The SELECT PI() FROM dual;
statement calls this function. dual
is a special one-row, one-column table present by default in Oracle Database. It’s used for calculations that aren’t really associated with any table.
PI()
Example
Output
Explanation
The above code uses the PI
function in SQLite to return the numeric value of Pi, which is approximately 3.14159265358979.