Mysql选择*语句并将其转换为删除语句

时间:2015-06-11 14:51:07

标签: mysql join

我制作了一个从9个表中提取的select语句。

select * 
from calls 
join cases using (tid) 
join case_history using (tid) 
join calls_audio_deleted using (tid) 
join audio_files using (tid) 
join windows using (audio_file_id) 
join labels using (window_id) 
join features using (window_id) 
join prs_info using (tid);

如何将其转换为删除语句。我想在(11,12,13,14 .....)中添加tid的条款;

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

delete calls, cases, case_history, audio_files, windows, labels, features, prs_info
from calls 
join cases using (tid) 
join case_history using (tid) 
join calls_audio_deleted using (tid) 
join audio_files using (tid) 
join windows using (audio_file_id) 
join labels using (window_id) 
join features using (window_id) 
join prs_info using (tid)
where calls.tid in (11, 12 ,13 ,14 .....);