MySQL error message

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adrian

    #1

    MySQL error message

    Dear All

    I'm a newbie to MySQL and I have this piece of SQL, which MySQL is
    complaining about:

    select ID, (select autorollforward from lucategory as b1 where
    a1.category = b1.ID), sdate, frequency, nofrepeats from session as a1
    where a1.adminID = 'user23' order by a1.ID asc

    Can anyone please give me a clue as to what's wrong with it? This is
    the error that MySQL is giving:

    [MySQL][ODBC 3.51 Driver][mysqld-4.0.20a-nt-max]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
    autorollforward from lucategory as b1 where a1.category

    Thanks for any help
    Adrian
  • Aggro

    #2
    Re: MySQL error message

    Adrian wrote:
    [color=blue]
    > select ID, (select autorollforward from lucategory as b1 where
    > a1.category = b1.ID), sdate, frequency, nofrepeats from session as a1
    > where a1.adminID = 'user23' order by a1.ID asc[/color]

    According to the error message you have MySQL server version 4.0.
    Subqueries are supported from version 4.1.

    So you can't use two selects in one query, you either need to upgrade
    your server or rewrite the query so that it doesn't use subqueries.

    Comment

    • Adrian

      #3
      Re: MySQL error message

      Aggro <spammerdream@y ahoo.com> wrote in message news:<ewuLc.183 $Dd2.126@read3. inet.fi>...
      [color=blue]
      > According to the error message you have MySQL server version 4.0.
      > Subqueries are supported from version 4.1.
      >
      > So you can't use two selects in one query, you either need to upgrade
      > your server or rewrite the query so that it doesn't use subqueries.[/color]


      Thanks, I've upgraded to 4.1 and everything now works fine.

      Cheers,
      Adrian

      Comment

      Working...