How to convert values from one column to UPPERCASE

Asked

Viewed 883 times

3

Using Mysql commands, it would be possible to convert all values from one column to UPPERCASE?

  • Type thus?

  • YES! is possible, either do an update or just compare?

  • @Andersoncarloswoss, exactly.

  • Hi @rray, update.

  • The example I put up only does select. You really need to change the database data?

  • Yes, because I need to compare values with another table (which I will also pass to UPPER). @Andersoncarloswoss

  • You can compare using ucase also.

  • 2

    http://stackoverflow.com/questions/12652444/mysql-query-to-change-a-lower-case-to-upper-case

  • @Andersoncarloswoss, taking advantage of the boat, can you assist me in this matter? http://answall.com/questions/188477/qual-alternativa-para-sql-latin1-general-cp1251-cs-as-em-mysql

  • @Leocaracciolo, thank you for the reference.

Show 5 more comments

1 answer

7


Use the UPPER()

SELECT:

SELECT UPPER(campo) FROM `tabela`

UPDATE:

UPDATE tabela SET campo = UPPER(campo)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.