MySQL Return Column Types from Select Statement


Is is possible to get the column types and names from a select statement in MySQL?


SELECT t.first_col, t.third_col
FROM my_table t

And then I would send that to MySQL and have it tell me.

column_name  |  type     | length
first_col    |  varchar  | 5
third_col    |  int      | null

I know I can do it in SQL Server I was hoping I can do it in MySQL too.

Best Answer

Why is that Questions come in pairs? This recent one discussed the solution you want:

MySQL data precision confusion