SQL特殊语句

查出所有的外键:

  SELECT concat('alter table `',table_schema,'`.',table_name,' DROP FOREIGN KEY ',constraint_name,';')
  FROM information_schema.table_constraints WHERE constraint_type='FOREIGN KEY';

posted @ 2021-12-21 15:44  蓝天wlx  阅读(42)  评论(0)    收藏  举报