如果表存在则删除

mysql:

DROP table if exists t_ibcp_equipment_ev_log;
create table t_ibcp_equipment_ev_log(
	id int(11) not null PRIMARY KEY ,
	ev_id int(11),
  workcenter_order_id int(11),
	inst_id int(11),
	step_prac_id int(11),
	CONSTRAINT t_ibc_fk FOREIGN KEY (ev_id)  REFERENCES  t_ibcp_event_start_end(id),
	CONSTRAINT t_ibcp_eqnce_fk FOREIGN KEY (inst_id)  REFERENCES  t_ibcp_equipment_instance(id),
	CONSTRAINT t_ibcp_wonter_fk FOREIGN KEY (workcenter_order_id)  REFERENCES  t_ibcp_workcenter_order(id),
	CONSTRAINT t_ibcp_sctice_fk FOREIGN KEY (step_prac_id)  REFERENCES  t_ibcp_process_step_practice(id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;able if exists address_book  


你可能感兴趣的:(数据库,SQL)