Getting error:For 'IN', types varchar and int are inconsistent DETAIL: Columns: unknown and unknown

Hi
I am trying to execute below query in vertica:

select case
when to_char(to_date('02-15-2017','mm-dd-yyyy'),'mm')in(1,2,3,4,5,6,7,8,9,10) then
(select to_char(add_months(trunc(to_date('02-15-2017','mm-dd-yyyy'),'year'),-2),'mm-dd-yyyy') from dual);
else
(select to_char(add_months(trunc(to_date('02-15-2017','mm-dd-yyyy'),'year'),10),'mm-dd-yyyy') from dual)
end ett from dual;

Query is getting expected results in oracle but in Vertica Getting error:For 'IN', types varchar and int are inconsistent DETAIL: Columns: unknown and unknown.

Expected Result is HP fiscal Start date as 1st Nov 2016.

Best Answer

Answers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file