Skip to content

How to clamp a float in PostgreSQL

I have a number 1.00000001, and I want to clamp it between -1 and 1 to avoid input out of range error on ACOS() function. An MCVE look like this: SELECT ACOS( 1 + 0.0000000001 ); My ideal would be …

ora-02270 How do i fix this?

This is what I have: CREATE TABLE STUDENTS( stu_id NUMBER(9) NOT NULL, stu_name VARCHAR2(15) NOT NULL, stu_address VARCHAR2(15), stu_major VARCHAR2(6), CONSTRAINT students_pk …