SQLite将第一个字母更新为大写

时间:2013-05-18 01:38:35

标签: sqlite

我有一个字段customer.country

我试图更新它,以便国家/地区中值的第一个字母为大写。我似乎无法找到一种方法。

2 个答案:

答案 0 :(得分:19)

UPDATE customer
  SET country = UPPER(SUBSTR(country, 1, 1)) || SUBSTR(country, 2)

答案 1 :(得分:3)

为什么不使用substr()来获取第一个字母和upper()呢?

upper(substr(customer.country, 1, 1))||substr(customer.country, 2)
相关问题