Forums

This topic is locked

Re: Advanced SQL Statement

Posted 06 Dec 2005 13:24:36
1
has voted
06 Dec 2005 13:24:36 Malcolm X posted:
Hiya to all.

Can anyone suggest where I would find a SQL crash course. I have currently created a site with a Access database. In DWMX04 I have created an advanced Recordset. In this recordset I have created a name, selected the database and then copied the SQL from access to the SQL section. My SQL reads like the following.
-----------------------------------------------------------------------------------------------
SELECT [tblSpecies].[Fruit Species], [tblSuppliers].[Supplier Name], [tblSuppliers].[Contact Name], [tblSuppliers].[Street Address], [tblSuppliers].[Suburb], [tblLocation].[Location], [tblSuppliers].[Post Code], [tblCountry].[Country], [tblSuppliers].[Phone Number], [tblSuppliers].[Facsimile], [tblSuppliers].[Email Address], [tblSuppliers].[Website Address], [tblSuppliers].[Short Description], [tblSuppliers].[Description], [tblSuppliers].[Image], [tblCategories].[CategoryTitle]
FROM tblSpecies INNER JOIN (tblCategories INNER JOIN ((tblLocation INNER JOIN (tblCountry INNER JOIN tblSuppliers ON [tblCountry].[idCountry]=[tblSuppliers].[idCountry]) ON [tblLocation].[idLocation]=[tblSuppliers].[idLocation]) INNER JOIN tblResults ON [tblSuppliers].[idSupplier]=[tblResults].[idSupplier]) ON [tblCategories].[idCategory]=[tblResults].[idCategory]) ON [tblSpecies].[idSpecies]=[tblResults].[idSpecies];
------------------------------------------------------------------------------------------------
When I search the database, I get results of all the listings I have on the database.

Can anyone suggest where I have gone wrong.

Sorry very new to SQL.

Thanks to all.

Mally.

Replies

Replied 08 Dec 2005 19:10:11
08 Dec 2005 19:10:11 stu h replied:
hiya,
whilst I'd love to read through that sql block and figure out the tables and their relationships, I'm lazy! Can you post what the tables are, what the relationships are and then what information you are tyring to obtain. Then at a guess either I or someone will be able to write the sql for you.

Reply to this topic