PDA

View Full Version : Re: Advanced SQL Statement


malhyp
12-06-2005, 11:15 AM
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.

davidj
12-06-2005, 11:18 AM
When I search the database, I get results of all the listings I have on the database.

well your not doing anything wrong and as i can tell you would get everything back coz you dont have a WHERE clause in your SQL