· 8 years ago · Jul 15, 2018, 04:02 PM
1drop table if exists mods;
2
3create table mods
4(
5id int not null primary key
6);
7
8insert into mods values (1),(2),(3),(4);
9
10drop table if exists mod_downloads;
11
12create table mod_downloads
13(
14id int not null auto_increment primary key,
15mid int not null
16);
17
18insert into mod_downloads (mid) values (1),(1),(1),(1),(2),(2),(3),(3),(3),(3),(4);
19
20select * from mods;
21select * from mod_downloads;
22
23delete from mods, mod_downloads using mods inner join mod_downloads on mods.id = mod_downloads.mid and mods.id = 2;
24
25select * from mods;
26select * from mod_downloads;