Pi Function In Sql in SQL
PI() Function in SQL
The PI() function returns the mathematical constant ? (pi), approximately 3.141592653589793.
Usage
SELECT PI();This returns the value of pi.
Example
Calculate the circumference of a circle with radius 5:
SELECT 2 * PI() * 5 AS circumference;Result:
| circumference |
|---|
| 31.4159265359 |
Supported In
MySQL
SQL Server
PostgreSQL
Oracle (as
PIwithout parentheses)
If you want, I can show you examples of other math functions in SQL!