SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: error on limits

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2003
    Location
    Saskatoon
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error on limits

    I am having some trouble getting the following limit to work...


    UPDATE works SET w_exhibition = (select e_name FROM exhibitions WHERE e_num_works = (select MIN(e_num_works) FROM exhibitions)) where w_location = 'storage' LIMIT (select MIN(e_num_works) FROM exhibitions);

    Everything works fine except for the LIMIT. If I change it to just say Limit 6 I still get an error. Am I doing something wrong?

    Thanks
    Zak

  2. #2
    SitePoint Addict toggg's Avatar
    Join Date
    Jan 2005
    Location
    Auvergne/France
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Zak,
    Seems OK, but which version are you ?
    Quoting MySQL's manual:
    Starting from MySQL 3.23, you can use LIMIT row_count to restrict the scope of the UPDATE.
    +
    bertrand Gugger toggg.com linux, PHP, Auvergne/France open source


Bookmarks

Posting Permissions

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