MySQL SHOW COLUMNS

2

I would like to just bring the columns of the bank and sort of form that I want for example:

show columns FROM table

The above code brings up all the columns in the table.

bring the ordered columns.

SHOW TABLE.COLUNA1,
     TABLE.COLUNA2
FROM TABLE
    
asked by anonymous 04.08.2017 / 17:55

1 answer

3

Try using INFORMATION_SCHEMA :

SELECT 'COLUMN_NAME' 
FROM 'INFORMATION_SCHEMA'.'COLUMNS' 
WHERE 'TABLE_SCHEMA'='yourdatabasename' 
    AND 'TABLE_NAME'='yourtablename';
    
04.08.2017 / 18:02