var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to find maximum value of 3 columns?
I have a table with 3 date columns and i want to find the maximum of 3 columns.
Table : EMPLOYEE(ID, Date1, Date2, Date3)
Now i want to execute the query:
SELECT ID, GREATEST(DATE1,, Date2, Date3) MAX_DATE FROM EMPLOYEE;
But Informix doesn't have support for GREATEST() function.
How can i do it in Informix?
For lack of a better way, you can do this:
create temp table test2
insert into test2 select eid, max(date1) from yourtable group by 1;
insert into test2 select eid, max(date2) from yourtable group by 1;
insert into test2 select eid, max(date3) from yourtable group by 1;
select eid, max(date1) from test2 group by 1;
if you need any other help, feel free to email: firstname.lastname@example.org