shorn
shorn

Reputation: 1357

Is it possible to change the values in a database column to lowercase?

I have an sql database (from an expressionengine install.)

Within the exp_channel_data table I have a column field_id_90 that contains only text values. The problem is all these values are in CAPITALS.

Ideally I would like them lowercase.

Is it possible to run a query or something to change these?

--UPDATED--

Thank you for the responses. Just wondering about whether or not its possible to Capitalise the values? Most of the values are single words, but some are "word,word" and some are "word-word" Is that possible?

Upvotes: 2

Views: 613

Answers (5)

Daan Timmer
Daan Timmer

Reputation: 15047

Lets make my comment an answer:

UPDATE table_name SET field_id_90=LCASE(field_id_90)

LCASE can also be known as LOWER in some languges

Upvotes: 1

Antoine
Antoine

Reputation: 558

Try :

SELECT lower (field_id_90)
FROM exp_channel_data;

Upvotes: 4

Darren
Darren

Reputation: 70728

Use LOWER (SQL Server)

SELECT LOWER(Column)
FROM Table

Or LCASE (MySQL)

SELECT LCASE(Column)
FROM Table

Upvotes: 1

Mike
Mike

Reputation: 1175

Yes it is. Use LCASE() or LOWER() http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_lcase

Upvotes: 1

Andomar
Andomar

Reputation: 238106

lower() should work for SQL Server, MySQL, Oracle and PostgreSQL:

select  lower(YourColumn)
from    YourTable

Upvotes: 1

Related Questions