By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,271 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,271 IT Pros & Developers. It's quick & easy.

SQL Query Syntax Error

P: n/a
------=_NextPart_000_004D_01C3456C.66EFEC50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hello

The following query used to work when I was using an Access database, but
now that I've moved to MySQL I get a syntax error when I try and run it:

SELECT *, (SELECT COUNT (*)
FROM Links
WHERE Links.CAT_ID = Categories.CAT_ID AND LINK_APPROVED = 'Yes') AS
LINK_COUNT FROM Categories
ORDER BY CAT_NAME ASC

The error message is this:

SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]syntax error near 'SELECT COUNT (*) FROM Links WHERE
Links.CAT_ID = Categories.CAT_ID AND LINK_AP' at line 1

Any immediate reactions? Thanks in advance for any help you can give me...

Best wishes

Trevor Sather

------=_NextPart_000_004D_01C3456C.66EFEC50--

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.