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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -