MySQL Forums
Forum List  »  General

Self-Join
Posted by: Rakesh Mahajan
Date: November 11, 2004 11:21PM

I have three tables. The first table is the samplesettable and every sample that I have has an entry in this table. Each sample may contain one or more integers and/or strings. Strings are stored in the stringtable and integers in the integertable. Each entry in the integer/string table has a link that relates it to the samplesettable. I am trying to build a query that looks something like the following:

Select Distinct sourceId from samplesettable as s1
Inner Join samplesettable as s2 On integertable.link = s2.link
Inner Join stringtable.link On s1.link = stringtable.link
Where integertable.name = 'someIntegerVariablesName'
And stringtable.name = 'SomeStringVariableName'

This query just hangs. There are about 100 samples totally with about 500 integer entries and 500 string entries. I am using MySQL 4.0.10 with the ODBC driver 3.51 with ASP.NET

The objective of the query is to find some sources which are of a certain type (borne out of the fact that they provide a certain integer sample) and then find the value for just these sources for a string sample.

Your help is appreciated.

Thanks,

RM

Options: ReplyQuote


Subject
Written By
Posted
Self-Join
November 11, 2004 11:21PM
November 12, 2004 06:23PM
November 12, 2004 07:24PM
November 12, 2004 07:33PM
November 13, 2004 12:41AM
November 13, 2004 05:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.