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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -