Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INNER JOIN HELP

Status
Not open for further replies.

manking

MIS
Jan 29, 2003
28
US
m converting from access to mysql this will not work can someone tell me why?

SELECT DISTINCTROW ads.ad_id, ads.name, ads.path, ads.filename, ads.href, ads.active,
ads.password, category.category_name, sum(performance.loads) as totalloads,
sum(performance.clickthru) as totalclicks
FROM (category INNER JOIN (ads INNER JOIN ad_category_link ON ads.ad_id = ad_category_link.ad_link)
ON category.category_id = ad_category_link.category_link) LEFT JOIN performance
ON ads.ad_id = performance.perf_ad_id
WHERE 1=1
GROUP BY ads.ad_id, ads.name, ads.path, ads.filename, ads.href, ads.active, ads.password, category.category_name
ORDER BY name


The error message is

ODBC Error Code = 42000 (Syntax error or access violation)

[TCX][MyODBC]You have an error in your SQL syntax near 'INNER JOIN ad_category_link ON ads.ad_id = ad_category_link.ad_link ON categor' at line 4

Any help will greatly be appriciated.
 
SELECT ads.ad_id, ads.name, ads.path, ads.filename, ads.href, ads.active,
ads.password, category.category_name, sum(performance.loads) as totalloads,
sum(performance.clickthru) as totalclicks
FROM ads INNER JOIN ad_category_link ON ads.ad_id = ad_category_link.ad_link INNER JOIN category
ON category.category_id = ad_category_link.category_link
LEFT JOIN performance
ON ads.ad_id = performance.perf_ad_id
GROUP BY ads.ad_id, ads.name, ads.path, ads.filename, ads.href, ads.active, ads.password, category.category_name
ORDER BY name
 
it appears mysql doesn't like the parentheses, whereas access requires them

as to why, well, i dunno, i guess that's just a quirk of those database engines


rudy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top