How to find out the values of all fields except a certain field in MySQL

For example, there are 20 fields in a certain table, and you want to see 19 fields, and handwriting is too troublesome, what should I do?

first step:

First find out the rest of the fields except this field, and use ',' to split

SELECT
       GROUP_CONCAT( column_name SEPARATOR ',' ) 
FROM
        information_schema.COLUMNS 
WHERE
        column_name <> 'fields you don't want' 
        AND table_name = 'table name' 
GROUP BY
        table_name


Step two:

The result of the first step of select is from the table name

Guess you like

Origin blog.csdn.net/m0_52191385/article/details/132214593