mysql query “SHOW COLUMNS FROM table like 'colmunname'”:questions

后端 未结 4 783
鱼传尺愫
鱼传尺愫 2021-02-14 14:27

I have a question about SHOW COLUMNS FROM table like \'column name\'\". I have already tried some tests for some times, it seems be similar like \"where colu

4条回答
  •  忘掉有多难
    2021-02-14 15:00

    Where is used to get an exact match where as like is used to get a wider range of columns using wildcards.

    SHOW COLUMNS FROM table like 'my%";
    

    The above will find all columns that begin with my.

    Where as with a where clause you cannot use wildcards and will only get returned exact matches. Obviously you could use where with between,> or < etc in other cases which would give you a wider range but still not allow you to use any wildcards.

提交回复
热议问题