tags:

views:

30

answers:

3

To get field names one would use the command:

select column_name from information_schema.columns where table_name='person'; 

My question is how would one also get the field types in a similar list?

+3  A: 
SELECT
    column_name,
    column_type    # or data_type 
FROM information_schema.columns 
WHERE table_name='person'; 

Schema Info

Ben S
Thanks, that was so simple
Richard
A: 
select column_name,
       column_type 
  from information_schema.columns 
 where table_name='person';
Mark Baker
A: 
SELECT
    column_name,
    data_type
FROM information_schema.columns 
WHERE table_name='person';
Gratzy