• <i id='5arnqcgh'><tr id='039zt4t5'><dt id='a6yikayq'><q id='np670u7a'><span id='gt6n6zbu'><b id='f3vw73gj'><form id='trn9ybhc'><ins id='bna4ynqh'></ins><ul id='h5rru2wr'></ul><sub id='ikmnuzg3'></sub></form><legend id='tzd07lr7'></legend><bdo id='ebppdwvv'><pre id='dpiol2zg'><center id='35d4zkwl'></center></pre></bdo></b><th id='6oe8pdft'></th></span></q></dt></tr></i><div id='377rd9le'><tfoot id='18bp9qxi'></tfoot><dl id='b2023mqz'><fieldset id='n4hdmro5'></fieldset></dl></div>
    <legend id='tfmsn8zp'><style id='usmn9k70'><dir id='apafmjx3'><q id='lti1mcs7'></q></dir></style></legend>

        <bdo id='v9wg3av4'></bdo><ul id='4heoz7ep'></ul>
        <tfoot id='4xx0fltu'></tfoot>

        <small id='6g735myf'></small><noframes id='vqsazjnc'>

      1. 欢迎来到入门教程网!

        Mysql

        当前位置:主页 > 数据库 > Mysql >

        mysql怎么看表大小写 mysql表大小查询

        来源:本站原创|时间:2023-04-02|栏目:Mysql|点击:

        使MySQL查询区分大小写的实现方法

        1、一种方法是可以设置表或行的collation,使其为binary或case

        sensitive。在MySQL中,对于Column

        Collate其约定的命名方法如下:

        *_bin:

        表示的是binary

        case

        sensitive

        collation,也就是说是区分大小写的

        *_cs:

        case

        sensitive

        collation,区分大小写

        *_ci:

        case

        insensitive

        collation,不区分大小写

        ###########

        #

        Start

        binary

        collation

        example

        ###########

        mysql

        create

        table

        case_bin_test

        (word

        VARCHAR(10))

        CHARACTER

        SET

        latin1

        COLLATE

        latin1_bin;

        Query

        OK,

        rows

        affected

        (0.02

        sec)

        mysql

        INSERT

        INTO

        case_bin_test

        VALUES

        ('Frank'),('Google'),('froogle'),('flickr'),('FlicKr');

        Query

        OK,

        5

        rows

        affected

        (0.00

        sec)

        Records:

        5

        Duplicates:

        Warnings:

        mysql

        SELECT

        *

        FROM

        case_bin_test

        WHERE

        word

        LIKE

        'f%';

        +---------+

        |

        word

        |

        +---------+

        |

        froogle

        |

        |

        flickr

        |

        +---------+

        2

        rows

        in

        set

        (0.00

        sec)

        mysql

        SELECT

        *

        FROM

        case_bin_test

        WHERE

        word

        LIKE

        'F%';

        +---------+

        |

        word

        |

        +---------+

        |

        Frank

        |

        |

        FlicKr

        |

        +---------+

        4

        rows

        in

        set

        (0.00

        sec)

        ###########

        #

        End

        ###########

        2、另外一种方法

        ###########

        #

        Start

        case

        sensitive

        collation

        example

        ###########

        mysql

        create

        table

        case_cs_test

        (word

        VARCHAR(10))

        CHARACTER

        SET

        latin1

        COLLATE

        latin1_general_cs;

        Query

        OK,

        rows

        affected

        (0.08

        sec)

        mysql

        INSERT

        INTO

        case_cs_test

        VALUES

        ('Frank'),('Google'),('froogle'),('flickr'),('FlicKr');

        Query

        OK,

        5

        rows

        affected

        (0.00

        sec)

        Records:

        5

        Duplicates:

        Warnings:

        mysql

        SELECT

        *

        FROM

        case_cs_test

        WHERE

        word

        LIKE

        'F%';

        +---------+

        |

        word

        |

        +---------+

        |

        Frank

        |

        |

        FlicKr

        |

        +---------+

        4

        rows

        in

        set

        (0.00

        sec)

        mysql

        SELECT

        *

        FROM

        case_cs_test

        WHERE

        word

        LIKE

        'f%';

        +---------+

        |

        word

        |

        +---------+

        |

        froogle

        |

        |

        flickr

        |

        +---------+

        2

        rows

        in

        set

        (0.00

        sec)

        ###########

        #

        end

        ###########

        3、还有一种方法就是在查询时指定collation

        mysql

        create

        table

        case_test

        (word

        VARCHAR(10))

        CHARACTER

        SET

        latin1;

        Query

        OK,

        rows

        affected

        (0.01

        sec)

        mysql

        INSERT

        INTO

        case_test

        VALUES

        ('Frank'),('Google'),('froogle'),('flickr'),('FlicKr');

        Query

        OK,

        7

        rows

        affected

        (0.01

        sec)

        Records:

        7

        Duplicates:

        Warnings:

        mysql

        SELECT

        *

        FROM

        case_test

        WHERE

        word

        LIKE

        'f%';

        +---------+

        |

        word

        |

        +---------+

        |

        Frank

        |

        |

        froogle

        |

        |

        flickr

        |

        |

        FlicKr

        |

        +---------+

        6

        rows

        in

        set

        (0.01

        sec)

        mysql

        SELECT

        *

        FROM

        case_test

        WHERE

        word

        LIKE

        'F%';

        +---------+

        |

        word

        |

        +---------+

        |

        Frank

        |

        |

        froogle

        |

        |

        flickr

        |

        |

        FlicKr

        |

        +---------+

        6

        rows

        in

        set

        (0.01

        sec)

        mysql

        SELECT

        *

        FROM

        case_test

        WHERE

        word

        COLLATE

        latin1_bin

        LIKE

        'F%';

        +---------+

        |

        word

        |

        +---------+

        |

        Frank

        |

        |

        FlicKr

        |

        +---------+

        4

        rows

        in

        set

        (0.05

        sec)

        mysql

        SELECT

        *

        FROM

        case_test

        WHERE

        word

        COLLATE

        latin1_bin

        LIKE

        'f%';

        +---------+

        |

        word

        |

        +---------+

        |

        froogle

        |

        |

        flickr

        |

        +---------+

        2

        rows

        in

        set

        (0.00

        sec)

        mysql

        SELECT

        *

        FROM

        case_test

        WHERE

        word

        LIKE

        'f%'

        COLLATE

        latin1_bin;

        +---------+

        |

        word

        |

        +---------+

        |

        froogle

        |

        |

        flickr

        |

        +---------+

        2

        rows

        in

        set

        (0.00

        sec)

        mysql

        SELECT

        *

        FROM

        case_test

        WHERE

        word

        LIKE

        'F%'

        COLLATE

        latin1_bin;

        +---------+

        |

        word

        |

        +---------+

        |

        Frank

        |

        |

        FlicKr

        |

        +---------+

        4

        rows

        in

        set

        (0.01

        sec)

        mysql

        SELECT

        *

        FROM

        case_test

        WHERE

        word

        LIKE

        'F%'

        COLLATE

        latin1_general_cs;

        +---------+

        |

        word

        |

        +---------+

        |

        Frank

        |

        |

        FlicKr

        |

        +---------+

        4

        rows

        in

        set

        (0.04

        sec)

        mysql数据库表名区分大小写

        使用mysql的时候,创建的表明都是大写的,但是查询语句中表明用消息就会报错,表不存在。

        查询后发现mysql默认配置是表明区分大小写的,如果要修改成不区分大小写,需要修改一下配置。

        mysql 怎么检查大小写敏感

        1、linux下mysql安装完后是默认:区分表名的大小写,不区分列名的大小写;

        2、用root帐号登录后,在/etc/my点吸烟f 中的[mysqld]后添加添加lower_case_table_names=1,重启MYSQL服务,这时已设置成功:不区分表名的大小写;

        lower_case_table_names参数详解:

        lower_case_table_names = 0

        其中 0:区分大小写,1:不区分大小写

        MySQL在Linux下数据库名、表名、列名、别名大小写规则是这样的:

        1、数据库名与表名是严格区分大小写的;

        2、表的别名是严格区分大小写的;

        3、列名与列的别名在所有的情况下均是忽略大小写的;

        4、变量名也是严格区分大小写的;

        MySQL在Windows下都不区分大小写。

        3、如果想在查询时区分字段值的大小写,则:字段值需要设置BINARY属性,设置的方法有多种:

        A、创建时设置:

        CREATE TABLE T(

        A VARCHAR(10) BINARY

        );

        B、使用alter修改:

        ALTER TABLE `tablename` MODIFY COLUMN `cloname` VARCHAR(45) BINARY;

        C、mysql table editor中直接勾选BINARY项。

            <bdo id='b9py4m78'></bdo><ul id='1xqf4r5x'></ul>
            <i id='ymtiqtrp'><tr id='zrlpspj7'><dt id='299v6lz1'><q id='rv4nlk0m'><span id='ortdlmxt'><b id='wh7zsmmd'><form id='w0uxdg66'><ins id='n23vm20m'></ins><ul id='c46arcjd'></ul><sub id='zqtlsx8u'></sub></form><legend id='42lpniku'></legend><bdo id='32zyn9bz'><pre id='w96ru1yj'><center id='dxf4p5f1'></center></pre></bdo></b><th id='ea81u9ck'></th></span></q></dt></tr></i><div id='ni1ikhaw'><tfoot id='t5rxli69'></tfoot><dl id='ru8813on'><fieldset id='zft3jclt'></fieldset></dl></div>

            • <tfoot id='f5engch1'></tfoot>
              1. <legend id='dcb2rv0o'><style id='rdpr44cu'><dir id='qaa3udlj'><q id='se3v4amh'></q></dir></style></legend>
              2. <small id='6tfj2wli'></small><noframes id='t24p4228'>

                    <tbody id='42rf2guo'></tbody>

                  上一篇:Mysql怎么关联多个表 mysql 关联

                  栏    目:Mysql

                  下一篇:怎么更改mysql到d盘 mysql怎么移到d盘

                  本文标题:mysql怎么看表大小写 mysql表大小查询

                  本文地址:https://www.xiuzhanwang.com/a1/Mysql/17182.html

                  网页制作CMS教程网络编程软件编程脚本语言数据库服务器

                  如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

                  联系QQ:835971066 | 邮箱:835971066#qq.com(#换成@)

                  Copyright © 2002-2020 脚本教程网 版权所有

                  <small id='k0g6gqkn'></small><noframes id='lm1uhxts'>

                1. <tfoot id='3mc3o3bq'></tfoot>

                  1. <legend id='bro76e92'><style id='qitaw0vd'><dir id='9ylwq04l'><q id='dg9navyw'></q></dir></style></legend>
                      <bdo id='mpjci7nw'></bdo><ul id='bilwjgoh'></ul>

                      <i id='3fe5w465'><tr id='vl63707g'><dt id='cxi9qtp6'><q id='pb75kdef'><span id='qs27ym1p'><b id='lm8m1odj'><form id='gl797hxs'><ins id='25n1ff0a'></ins><ul id='v8byes04'></ul><sub id='odpnp8ge'></sub></form><legend id='xxp4a9yd'></legend><bdo id='5g48h7sz'><pre id='fc804ili'><center id='67wgmvz4'></center></pre></bdo></b><th id='qpndz5cu'></th></span></q></dt></tr></i><div id='qoxvpuxa'><tfoot id='0w0qi997'></tfoot><dl id='2kits4ak'><fieldset id='uj7rg681'></fieldset></dl></div>