Results 1 to 3 of 3

Thread: SQL question

  1. #1
    Join Date
    Apr 2001
    Location
    Netherlands
    Posts
    191

    Unanswered: SQL question

    I want to do a query, I know the syntax in Oracle but it doesn't work in MySQL. In Oracle it would be:

    select nbre from users where id= (select max(id) from users)

    or

    select nbre from users having max(id)

    How do i do this in MySQL ??
    Ruud Schilders
    -----------------
    Oracle DBA
    e-mail : ruud@schilders.it
    URL : www.schilders.it
    Twitter : www.twitter.com/ruudschilders

  2. #2
    Join Date
    Apr 2002
    Posts
    3
    The first query won't work because MySQL doesn't support Sub-Selects.

    As for the second query, you need to look at the manual and find out what MySQL WHERE-CLAUSE functions you can use to get the comparable ORACLE effect of what you wish to achieve in MySQL.

  3. #3
    Join Date
    May 2002
    Posts
    1

    MySQL Max

    Ruudboy,

    Does this help? It's a link to the online MySQL docs.

    http://www.mysql.com/doc/e/x/example...um-column.html

    Best of luck,

    Bonewalker

Posting Permissions

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