I can update the value in the table separately and I am able to filter the tables as I want, but I'm having trouble combining the two
I've looked at running a sql query on another one but was only able to find something like this.
SELECT <SOMETHING HERE> FROM
(
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE 'table&example'
) AS SUBQUERY
This is how I'm updating the value in the table.
UPDATE `table_1_example` SET `comment_status` = 'closed' WHERE `post_type` = 'attachment' AND `comment_status` = 'open';
This is how I can get all the tables I need
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE 'table%example'
Edit:
I also just found this post which explains how to update multiple identical columns over many tables.
And they did something like this
If that's a one time task, just run this query, copy & paste the result to query window and run it
Select 'UPDATE ' + TABLE_NAME + ' SET CreatedDateTime = ''<<New Value>>'' '
From INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'CreatedDateTime'
though I'm not really sure what they mean by query window... I'm using MySQL workbench by the way.
I got this figured out now using the above script I made something that looks like this.
SELECT 'UPDATE ' + TABLE_NAME + ' SET comment_status = ''closed'' WHERE post_type = ''attachment'' AND comment_status = ''open'';'
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE 'test&example'