1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    How to I update a row base on the lowest value of a particular column?

    |2| |
    |1|X| <-- update X
    |3| |

    What is the command to use?
    I can do "select min(A) from table;" but not "update table set B=1 where min(A);".
    Anyone expert in SQL language, please help!
  2. #2
  3. No Profile Picture
    rod k
    Devshed Newbie (0 - 499 posts)
    I'm not sure if this will work, I don't have access to mysql at the moment but give it a shot.

    update table set B=1 where A=min(A);

Similar Threads

  1. Replies: 1
    Last Post: October 8th, 2004, 08:07 AM
  2. updating a slew of values into MySQL from a form
    By proxy in forum PHP Development
    Replies: 2
    Last Post: September 15th, 2003, 06:05 AM
  3. Replies: 8
    Last Post: March 4th, 2003, 08:56 AM
  4. Not checking current password before updating?
    By Escape in forum PHP Development
    Replies: 5
    Last Post: August 13th, 2002, 10:13 PM
  5. Help with updating mysql tables
    By baldy in forum Beginner Programming
    Replies: 2
    Last Post: November 7th, 2001, 01:29 PM

IMN logo majestic logo threadwatch logo seochat tools logo