albatross68
Programmer
I have a table with the following fields (among others):
The idea is that a number of records may exist in this table for a given ext_id, but tid is unique and increases with each new record
My goal is to locate the most recent record for a given ext_id (say 12345). So I tried:
This does not work as expected when no record exists in the table for ext_id = 12345. In this case -as far as I can tell- the result is the maximum tid in the table (i.e. as if there was no WHERE clause in my query).
Also if the table is empty, I get a runtime error -201.
Please note that the installation uses an old version of Informix (7.x).
Code:
tid SERIAL
ext_id INTEGER
My goal is to locate the most recent record for a given ext_id (say 12345). So I tried:
Code:
SELECT MAX(tid) INTO last_tid
FROM table
WHERE ext_id = 12345
Also if the table is empty, I get a runtime error -201.
Please note that the installation uses an old version of Informix (7.x).