In order to get cube root of column in postgresql we use CBRT() function. CBRT() function in posgresql gets the cube root of the column. Let’s see how to
- Get cube root in postgresql
- Create the column which extracts the cube root from another column
With an example for both
Get Cube root in Postgresql:
CBRT() function in posgresql gets the cube root value
SELECT CBRT(27) AS "Cube Root";
So the cube root will be
Get Cube root of column in Postgresql table:
We use table student_details
SELECT *,CBRT(gradscore) AS cuberoot_gradscore FROM student_detail;
We have created a column and stored cuberoot of gradscore column.
So the resultant table will be