// you’re reading...

How2

MySQL: Convert all Values in Column to Upper Case

Recently using osCommerce I had a customer who wished to have all the products’ names in uppercase but they had been entered in mixed case. After having some trouble finding a simple answer through Google, I pieced together this simple query that can also be adapted to other situations.

MySQL Query

The below is a MySQL query to update all of the products’ names in an osCommerce catalog to uppercase - you can copy this into phpMyAdmin.

UPDATE products_description SET `products_name` = UPPER( `products_name` )

OR GENERICALLY:

UPDATE table_name SET `column_name` = UPPER( `column_name` )

Discussion

5 comments for “MySQL: Convert all Values in Column to Upper Case”

  1. Tnx, Great hint!

    Posted by Charson | January 4, 2010, 11:36 am
  2. thank you!

    Posted by ixiel | April 13, 2010, 10:56 am
  3. Thank u gr8 help

    Posted by sachin saxena | October 8, 2010, 12:04 am
  4. Thanx a lot that was really helpful!

    Posted by VAL | January 28, 2011, 3:21 am
  5. thanks that was really helpful. worked me out when i needed the most.

    Posted by sekhon | May 4, 2011, 3:09 am

Post a comment

Advertisement

Categories