delete
може да обработва само една таблица наведнъж, така че ще ви трябват три оператора:
DELETE FROM upklist
WHERE session_id = (SELECT session_id
FROM usession
WHERE delete_session_id IS NULL
AND user_id = (SELECT user_id
FROM users
WHERE REGEXP_LIKE(USER_NAME,
'awpeople', 'i')));
DELETE FROM projshar
WHERE session_id = (SELECT session_id
FROM usession
WHERE delete_session_id IS NULL
AND user_id = (SELECT user_id
FROM users
WHERE REGEXP_LIKE(USER_NAME,
'awpeople', 'i')));
DELETE FROM usession
WHERE session_id = (SELECT session_id
FROM usession
WHERE delete_session_id IS NULL
AND user_id = (SELECT user_id
FROM users
WHERE REGEXP_LIKE(USER_NAME,
'awpeople', 'i')));
Имайте предвид, че тъй като вътрешната заявка разчита на usersession
, трябва да изтриете от него последния .