tags:

views:

47

answers:

1

Hi Guys,

Is it possible to have a DESCRIBE table clause inserted as a subquery in FROM of a SELECT clause in MySQL?

Further, is there a way to enforce a WHERE like condition on a DESCRIBE output?

EDIT: Basically, I have a table with a large number of columns and I want to pull out and act upon the particulars of only one column.

+2  A: 

you can use INFORMATION_SCHEMA instead as following:

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'Database Name'
AND TABLE_NAME = 'Table Name' and any condition you want...;
Wael Dalloul
It worked! Thanks :)
Crimson
Just remember that INFORMATION_SCHEMA exists in MySql only in version 5.0 and above.
Leonel Martins