Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Subqueries
Thu, Apr 5 2007 1:14 PMPermanent Link

"Greg Bishop"
If I execute the following query in either EDB Manager or in a TEDBQuery
(both versions 1.02), I get two records returned:

 SELECT AnalyteID FROM AnalyteToTestMethod WHERE TestMethodID =
'{98D8B7A5-F70A-4D2F-BC5F-ED18EA2AB404}'

However, if I execute this query (with the above query being a subquery), I
get only one record returned:

 SELECT ID, Name, Abbreviation FROM Analyte WHERE ID IN (SELECT AnalyteID
FROM AnalyteToTestMethod WHERE TestMethodID =
'{98D8B7A5-F70A-4D2F-BC5F-ED18EA2AB404}')

My expectation is to get two records returned in the second query as well.
Any thoughts?

Fri, Apr 6 2007 3:02 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Greg,

<< However, if I execute this query (with the above query being a subquery),
I get only one record returned:

 SELECT ID, Name, Abbreviation FROM Analyte WHERE ID IN (SELECT AnalyteID
FROM AnalyteToTestMethod WHERE TestMethodID =
'{98D8B7A5-F70A-4D2F-BC5F-ED18EA2AB404}')

My expectation is to get two records returned in the second query as well.
>>

How many rows are in the Analyte table that match the sub-query ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Apr 7 2007 8:27 PMPermanent Link

"Greg Bishop"
> How many rows are in the Analyte table that match the sub-query ?

There are two rows within the Analyte table that match the sub-query.

I did an experiment by creating another database with the same table names.
But, I changed the ID fields to be integers.  With the IDs being integer
values, the query works as expected.  So, does it have something to do with
using the GUIDs?

Mon, Apr 9 2007 4:02 AMPermanent Link

"Greg Bishop"
Okay, I'm not sure what is going on now.  I deleted all of the data in the
tables with GUID fields and recreated the data.  Now the query is behaving
as expected with the GUIDs.

I'll report back here if I encounter any more issues related to this.

Mon, Apr 9 2007 7:12 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Greg,

<< Okay, I'm not sure what is going on now.  I deleted all of the data in
the tables with GUID fields and recreated the data.  Now the query is
behaving as expected with the GUIDs.

I'll report back here if I encounter any more issues related to this.  >>

It's possible that the table indexes were corrupted, but that would only
occur if you had possibly reset the application during operation in the IDE,
etc.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image