0

There are mysql-methods like "Show column_name" or "DESCRIBE table".

But how can I get only specified column names?

column names: id,name,values,info -> Get only column names: id,name (not also values,info).

icemanzzz
  • 11
  • 2
  • use `information_schema` – juergen d Mar 31 '16 at 15:05
  • If it is of any interest to anyone, I wrote a *Describe All Tables* in [this Answer](http://stackoverflow.com/a/38679580). You could craft that to ditch the columns not of interest, like *Extra* or *Null*, or Add other columns out of `INFORMATION_SCHEMA` – Drew Jul 31 '16 at 00:39

1 Answers1

0

According to this link :

SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE table_name = 'tbl_name'
  [AND table_schema = 'db_name']
  [AND column_name LIKE 'wild']

SHOW COLUMNS
  FROM tbl_name
  [FROM db_name]
  [LIKE 'wild']
androidnation
  • 626
  • 1
  • 7
  • 19