mysql
如題,怎麼先判斷外鍵是否存在,然後在刪除,像
if EXISTS((SELECT COUNT(*) FROM information_schema
.KEY_COLUMN_US
information_schema
.KEY_COLUMN_US
information_schema.
KEY_COLUMN_US 💎
org_employee
drop foreign key fk_emp_dept_id
; 還有,
if EXISTS((SELECT COUNT(*) FROM
information_schema
. > 0) BEGIN
alter table org_employee
drop foreign key
fk_emp_dept_id
;
回覆內容:
🎜https://zhidao.baidu.com/question/692089969116125764.html🎜