Categories
Database MySQL

Selecting Field Names in MySQL

Selecting field names in MySQL is pretty easy, though it's not quite like the SELECT syntax we're all used to:

SHOW COLUMNS FROM TABLE;

To select all fields that start with 'customer' we extend that a little bit, note the wild card to select all fields that start with 'customer'.

SHOW COLUMNS FROM TABLE LIKE 'customer%';

Leave a Reply