How to delete rows from tables starting with a prefix

I have multiple tables all starting with the prefix of pfsense_

I would like to know how I can delete all rows from the tables starting with pfsense_ where column CUUID = blah
ITNCAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Daniel WilsonConnect With a Mentor Commented:
You need to write a query that will write the final query for you.

select concat('delete from ' ,  table_name , ' Where CCUID = ''BLAH'';') from information_schema.tables where table_schema = 'MyDBName' and table_name like 'pfsense_%';

Open in new window


Paste the results of that query into a text editor to take off the | symbols.

then run that as your query.
0
All Courses

From novice to tech pro — start learning today.