The Vertica Forum is getting a makeover! The site will be undergoing maintenance from Tuesday 8/13 to Friday 8/16. We appreciate your patience and cooperation during this time.

Getting the Root of a Number

Jim Knicely authored this tip.

You can find the square root of a number with the |/ operator and the cube root of a number with the ||/ operator.

Example:

dbadmin=> SELECT |/25 square_root_of_25,
dbadmin->        ||/27 cube_root_of_27;
 square_root_of_25 | cube_root_of_27
-------------------+-----------------
                 5 |               3
(1 row)

Have fun!

Sign In or Register to comment.

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.