Rowid problem
Posted in 1993
Topics: SQL Development & Query Writing
Hello there,
I've encountered a problem concerning rowid's in Informix-SQL 4.10:
When executing a join for two tables, say company and country,
SELECT company.rowid, company.name, country.name
FROM company, country
WHERE company.cntrcode = country.cntrcode
AND company.compnr IN (SELECT UNIQUE compnr FROM project),
I don't get the rowid's from the company-table, but from some temporary
table, created by SQL in the process probably.
When I start the WHERE -clause with "WHERE 1=1 AND ..." however, I get the
RIGHT rowid's. But, to make it even more confusing, when I place the 1=1 part
at the end of the WHERE -clause, it doesn't work.
Alternatively, when I leave out the sub SELECT condition (companies with
existing projects), I also get the RIGHT rowid's.
What I want to know is: What difference could the 1=1 part possibly make,
has anybody experienced a similar problem and are there any solutions?
Thanks in advance,