join - Can I use one table column value as another table table name in mysql? -
i want build query ->
select table1.colname,(select count(*) table1.colname) count table1;
is possible in mysql?
please me..
you try using stored procedure, one:
create procedure test_procedure() reads sql data begin declare table_name varchar(50); declare cur_input cursor select table1.colname table1; open cur_input; loop1:loop fetch cur_input table_name; select table_name,(select count(*) table_name) count table1; end loop loop1; end;
Comments
Post a Comment