I get a syntax error when I run the following:
show columns from (select * from (select * from my_table) as T)
How can I show the columns from a query that I wrote, rather than from a table?
I get a syntax error when I run the following:
show columns from (select * from (select * from my_table) as T)
How can I show the columns from a query that I wrote, rather than from a table?
I use something like this:
create procedure showFields(s text)
begin
set @showfields_var:=concat('create temporary table tmp_showfields as select * from (',s,')a where 0');
prepare phrase from @showfields_var;execute phrase;
show columns from tmp_showfields;
drop temporary table tmp_showfields;
end