Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    2

    Unanswered: MySQL 4.0: why my SQL syntax wrong?

    Good day.

    I cannot query my MySQL 4.0 database.

    When I try to execute:

    Code:
    SELECT T.NAME, C.CNT
    FROM TAGS T
    INNER JOIN (
    SELECT TAG_ID, COUNT(*) AS CNT
    FROM TAGS_FEEDS
    GROUP BY TAG_ID
    HAVING CNT >=1
    ) C ON C.TAG_ID = T.ID
    I recieve:

    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT TAG_ID, COUNT( * ) AS CNT
    FROM TAGS_FEEDS GROUP BY T

    This query works fine on MySQL 4.1 on the database having same structure. So, why old server cannot execute this query and how should i change it?

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Posts
    2

    subquery maybe not supported in version 4

    Hi!

    If I remember right the subquery in MySQL was not supported in 4.0 but in 4.1

    I had experienced similar problem before and my suggestion is you upgrade MySQL to 4.1 or version 5, or try to program around the limitation.

    /Wei

  3. #3
    Join Date
    Feb 2006
    Posts
    2
    Unfortunateny, You are right. I didn't thing that 4.0 and 4.1 have serious changes. I was wrong.

    Thank you for reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •