Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

數學函式

These are all the functions defined in the math module:

functionparametersdescription
abscolAbsolute value of col
acoscolArccosine of col
asincolArcsine of col
atancolArctangent of col
ceilcolRounds the number up of col
coscolCosine of col
degreescolConverts radians to degrees
expcolExponential of col
floorcolRounds the number down
lncolNatural logarithm of col
logb colb-log of col
log10col10-log of col
piThe constant π
次方b colComputes col to the power b
radianscolConverts degrees to radians
roundn colRounds col to n decimal places
sincolSin of col
sqrtcolSquare root of col
tancolTangent of col

範例

PRQL

from employees
select age_squared = (age | math.pow 2)

SQL

SELECT
  POW(age, 2) AS age_squared
FROM
  employees