• <small id='UUiHi'></small><noframes id='UUiHi'>

    <legend id='UUiHi'><style id='UUiHi'><dir id='UUiHi'><q id='UUiHi'></q></dir></style></legend>
  • <i id='UUiHi'><tr id='UUiHi'><dt id='UUiHi'><q id='UUiHi'><span id='UUiHi'><b id='UUiHi'><form id='UUiHi'><ins id='UUiHi'></ins><ul id='UUiHi'></ul><sub id='UUiHi'></sub></form><legend id='UUiHi'></legend><bdo id='UUiHi'><pre id='UUiHi'><center id='UUiHi'></center></pre></bdo></b><th id='UUiHi'></th></span></q></dt></tr></i><div id='UUiHi'><tfoot id='UUiHi'></tfoot><dl id='UUiHi'><fieldset id='UUiHi'></fieldset></dl></div>
      <bdo id='UUiHi'></bdo><ul id='UUiHi'></ul>
    <tfoot id='UUiHi'></tfoot>

      1. 将现有表格中每个单词的首字母大写

        时间:2023-05-24
        <tfoot id='xpmxJ'></tfoot>
        <legend id='xpmxJ'><style id='xpmxJ'><dir id='xpmxJ'><q id='xpmxJ'></q></dir></style></legend>
      2. <small id='xpmxJ'></small><noframes id='xpmxJ'>

            <i id='xpmxJ'><tr id='xpmxJ'><dt id='xpmxJ'><q id='xpmxJ'><span id='xpmxJ'><b id='xpmxJ'><form id='xpmxJ'><ins id='xpmxJ'></ins><ul id='xpmxJ'></ul><sub id='xpmxJ'></sub></form><legend id='xpmxJ'></legend><bdo id='xpmxJ'><pre id='xpmxJ'><center id='xpmxJ'></center></pre></bdo></b><th id='xpmxJ'></th></span></q></dt></tr></i><div id='xpmxJ'><tfoot id='xpmxJ'></tfoot><dl id='xpmxJ'><fieldset id='xpmxJ'></fieldset></dl></div>
              <tbody id='xpmxJ'></tbody>
              • <bdo id='xpmxJ'></bdo><ul id='xpmxJ'></ul>
                1. 本文介绍了将现有表格中每个单词的首字母大写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个现有表people_table",其中包含一个字段 full_name.

                  I have an existing table 'people_table', with a field full_name.

                  许多记录的full_name"字段填充了错误的大小写.例如'fred Jones''fred jones''Fred jones'.

                  Many records have the 'full_name' field populated with incorrect casing. e.g. 'fred Jones' or 'fred jones' or 'Fred jones'.

                  我可以通过以下方式找到这些错误的条目:

                  I can find these errant entries with:

                  SELECT * FROM people_table WHERE full_name REGEXP BINARY '^[a-z]';
                  

                  如何将找到的每个单词的第一个字母大写?例如'fred Jones' 变成 'Fred Jones'.

                  How can I capitalize the first letter of each word found? e.g. 'fred jones' becomes 'Fred Jones'.

                  推荐答案

                  没有 MySQL 函数可以做到这一点,您必须自己编写.在以下链接中有一个实现:

                  There's no MySQL function to do that, you have to write your own. In the following link there's an implementation:

                  http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/

                  为了使用它,首先需要在数据库中创建函数.例如,您可以使用 MySQL 查询浏览器(右键单击数据库名称并选择创建新函数)来执行此操作.

                  In order to use it, first you need to create the function in the database. You can do this, for example, using MySQL Query Browser (right-click the database name and select Create new Function).

                  创建函数后,您可以使用如下查询更新表中的值:

                  After creating the function, you can update the values in the table with a query like this:

                  UPDATE users SET name = CAP_FIRST(name);
                  

                  这篇关于将现有表格中每个单词的首字母大写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 Python 中使用列名检索 SQL 结果列值? 下一篇:MySQL选择与CONCAT条件

                  相关文章

                2. <small id='shaQo'></small><noframes id='shaQo'>

                    <bdo id='shaQo'></bdo><ul id='shaQo'></ul>
                  1. <i id='shaQo'><tr id='shaQo'><dt id='shaQo'><q id='shaQo'><span id='shaQo'><b id='shaQo'><form id='shaQo'><ins id='shaQo'></ins><ul id='shaQo'></ul><sub id='shaQo'></sub></form><legend id='shaQo'></legend><bdo id='shaQo'><pre id='shaQo'><center id='shaQo'></center></pre></bdo></b><th id='shaQo'></th></span></q></dt></tr></i><div id='shaQo'><tfoot id='shaQo'></tfoot><dl id='shaQo'><fieldset id='shaQo'></fieldset></dl></div>
                    <legend id='shaQo'><style id='shaQo'><dir id='shaQo'><q id='shaQo'></q></dir></style></legend>

                      <tfoot id='shaQo'></tfoot>