Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    Question Unanswered: update one column in matching records from a pattern found in another column

    n00b question. Got a products table set up by a shopping cart script. The two columns are pID and pExemptions. Need to update all the pExemptions with the number 4 in records that match the pID starting with the first three characters "MP3." How could I use phpMyAdmin for this?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sample rows, please
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    wite an update query

    update mytable set mycolumn = 4 where mycolumn2 like "MP3%"
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2008
    Posts
    2
    thanks! worked great

Posting Permissions

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