Jump to content


Photo

Need MySQL Help ....


  • Please log in to reply
2 replies to this topic

#1 jimbobsquarepants

jimbobsquarepants
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 04 September 2006 - 03:32 PM

We have a MySQL database, in one of the tables there is a column called product_code and one called product_format. All the products that have a product_code that starts with the letter A are say books... and then the letter B are DVD's ....

So what i want to know is how i do i make it look in the product_code column for items that start with A and make it put Book in the products_format.

Thanks Guy  ;D

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 04 September 2006 - 03:35 PM

UPDATE products SET product_format='Book' WHERE product_code LIKE 'A%';

mod edit: code A is books

#3 jimbobsquarepants

jimbobsquarepants
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 05 September 2006 - 12:08 PM

Ohhhhh now i see lol

Worked great cheers  ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users