elarichi.y elarichi.y - 2 months ago 6
MySQL Question

Views related to a mysql table

How can I get all the views related to a table?
I want to alter that table but don't know which views use it in their select query.

Answer

Untested, but I think this might work.

The INFORMATION SCHEMA holds the metadata of your databases, including (among many other things), information about views.

So something like this might be useful:

select *
from information_sechema.views
where view_definition like '%yourTableName%'

Reference: