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

后端 未结 4 773
鱼传尺愫
鱼传尺愫 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:07

    SHOW ... LIKE behaves like the use of the LIKE operator in the WHERE clause of a common query:

    SHOW COLUMNS Syntax

    SHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name] [LIKE 'pattern' | WHERE expr]

    SHOW COLUMNS displays information about the columns in a given table. It also works for views. The LIKE clause, if present, indicates which column names to match. The WHERE clause can be given to select rows using more general conditions, as discussed in Section 21.32, “Extensions to SHOW Statements”.

    Emphasis by me.

提交回复
热议问题