When I run the following query on a postgres database, it works well. But on an oracle database it sends error
ORA-01722: invalid number
This query on oracle had been working till one week ago, and during this week it generates an error.
The general syntax is as below:
SELECT MIN(idd) FROM
(SELECT CAST(id AS INTEGER) idd
FROM prev_table) new_table
Without the MIN function, it works.
The problem occurs when I use MIN() to get the minimum id.
In this prev_table, id column is defined as varchar, and I want to convert them to integer and then get minimum.