Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Posts
    3

    Red face Unanswered: mysql select error

    hi guys,

    i get this sql select

    SELECT COUNT(DISTINCT EntrantsEpost) AS Expr1 FROM ENTRIES WHERE (EntrantsEpost IN (SELECT EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP BY EntrantsEpost HAVING COUNT(*) = 24))

    to work correctly on mssql 2000, but i just get the following error in mysql


    [MySQL][ODBC 3.51 Driver][mysqld-4.0.26-nt]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 EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP

    but i don'tsee the error. does anyone have any ideas?

    thanks in advance.

    marz

  2. #2
    Join Date
    Apr 2005
    Location
    Lier, Belgium
    Posts
    122
    Quote Originally Posted by marzipan
    SELECT COUNT(DISTINCT EntrantsEpost) AS Expr1 FROM ENTRIES WHERE (EntrantsEpost IN (SELECT EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP BY EntrantsEpost HAVING COUNT(*) = 24))

    to work correctly on mssql 2000, but i just get the following error in mysql


    [MySQL][ODBC 3.51 Driver][mysqld-4.0.26-nt]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 EntrantsEpost FROM ENTRIES WHERE RightOrWrong = 1 GROUP

    but i don'tsee the error.
    MySQL 4.0.26 does not support subqueries.

    --
    felix

  3. #3
    Join Date
    Nov 2005
    Posts
    3

    Red face

    hi felix,

    is there no other way around this? there are around 50 sql selects in the site and they all feature sub queries and i don't know where to start to convert them.


    ...i'm a bit worried now. i guess its fair to say

    Marz

  4. #4
    Join Date
    Apr 2005
    Location
    Lier, Belgium
    Posts
    122
    Quote Originally Posted by marzipan
    is there no other way around this?
    If you don't want to rewrite your queries, the only way is to upgrade to at least MySQL 4.1

    --
    felix

  5. #5
    Join Date
    Nov 2005
    Posts
    3
    thanks felix.

    i think we'll need to upgrade.

    thanks for helping me out today,....i thought i was going a bit crazy!

    Marz

Posting Permissions

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