Subject RE: [firebird-support] Bug or limitation inf FB 1.5
Author Mercea Paul
Is possible to have more than one row in table 1 who match the criteria of
ID from table 2?
I think is very possible,can you verify?
try
SELECT FIRST 1 id in
FROM table2
WHERE table2.number > 3
ORDER BY table2.number

Remember this id_value
And then

Select * from table1
WHERE table1.id=id_value

How many rows you get?More than one!

Regards,
Paul


From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Tim Gahnström
Sent: 19 June 2008 19:54
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Bug or limitation inf FB 1.5

Hi

Today I noticed a bug or limitation in our FB, I can obviously rewrite my
query but I figured there might be in interesting explanation floating
around:

Select * from table1
WHERE table1.id IN
(SELECT FIRST 1 id in
FROM table2
WHERE table2.number > 3
ORDER BY table2.number
)

I figured this should only return one row in total but apparently the system
optimizes the "FIRST 1" part away in the inner query.

I believe it is common that this is not allowed in other DBs but here I get
no complaints, instead I just get the full set of rows mathcing the inner
query returned.

Cheers

Tim