View Single Post
Old 04-12-2008, 11:46 AM   #17 (permalink)
Grooverider
hildog
 
Grooverider's Avatar
 
Join Date: Aug 2002
Posts: 844
-1 Internets
Right - I need help constructing the query

Thanks for all the advice so far, the database is constructed almost exactly how you guys have told me to make it.

Right here it is:

Table 1: a-data
Fields: [a-ID] - [CompID] - [KeywordID] - [Pos] - [Log1] - [Log2] - [TF] - [url] - [date]

Table 2: company
Fields: [companyID] - [CompanyName]

Table 3: keyword
Fields: [keywordID] - [keyword]

(keywordID in Table 3 = keywordID in table 1)
(companyID in table 2 = compID in table 1)

So i'm doing the following query


SELECT distinct keywordID from a-data where CompID like "%10%"

So this replies the keyword ID's that CompID containing 10 is related to.

Now, to take it to the next step:

I want to search for MBNA (for example), and 'join' the CompID to the CompanyID table. I then want to join the keywordID's to their text equivilent in the Keyword table..

Can anyone help me with this query.. I'm googling but no joy.
Grooverider is offline   Reply With Quote

 
Uberguilds Network