MySQL Update Column range

Discussion in 'MySQL' started by Astroman, May 27, 2008.

  1. #1
    Does anyone know if it's possible to update a column between a range of numbers?

    For instance I'm using this:
    update vid_site set title="Battery Park";
    Code (markup):
    To set the 'title' column in the 'site' table to 'Battery Park' for every entry, but what if I only want to change rows 21 through 132 to say Battery Park?
     
    Astroman, May 27, 2008 IP
  2. Astroman

    Astroman Well-Known Member

    Messages:
    2,355
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Oo, I think I figured out part of it.

    I can run:

    update vid_site set title="Battery Park" where pid >100;
    Code (markup):
    To change the title to battery Park for everything after 100. I know it sounds dull but it's quite exciting to me, I never figured anything like this out before. :)
     
    Astroman, May 27, 2008 IP