Hi,
Is there a function in Vertica like the INT function in Oracle?
Example INT(4.56) would be 4.
Thanks!
Is there an INT funtion in vertica?
Moderator: NorbertKrupa
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: Is there an INT funtion in vertica?
Are you just looking for the FLOOR function?
Code: Select all
dbadmin=> SELECT FLOOR('4.56');
FLOOR
-------
4
(1 row)
Checkout vertica.tips for more Vertica resources.
Re: Is there an INT funtion in vertica?
Yeah, thanks Norbert! For some reason I thought I tried that function and observed rounding issues, so I was using the TRUNC function, like this:
The FLOOR function is obviously the better choice
Code: Select all
dbadmin=> SELECT FLOOR(4.56), TRUNC(4.56)::INT;
FLOOR | TRUNC
-------+-------
4 | 4
(1 row)