Problem with Dynamic table names.
I am looking for a way to do the following with a single query: SELECT `ID`, `Name`, `Interface`, (select count(*) FROM CONCAT('listings_', `ID`) WHERE `Status`='Active') as `activeListings` FROM `sites`
Re: Problem with Dynamic table names.
I accidentally sent it before finishing... I am looking for a way to do the following with a single query: SELECT `ID`, `Name`, `Interface`, (SELECT count(*) FROM CONCAT('listings_', `ID`) WHERE `Status`='Active') as `activeListings` FROM `sites` I am querying the sites table and I want to