嘿伙计们,我想要这样的东西:
DELETE FROM ClientsFlags
WHERE clientId = (SELECT id
FROM Client
WHERE emailRegistrationToken = 3)
AND flagId = 42;
但是使用连接而不是子查询。我不太擅长加入,所以请帮帮我。
嘿伙计们,我想要这样的东西:
DELETE FROM ClientsFlags
WHERE clientId = (SELECT id
FROM Client
WHERE emailRegistrationToken = 3)
AND flagId = 42;
但是使用连接而不是子查询。我不太擅长加入,所以请帮帮我。
这是一个加入版本,
DELETE a
FROM ClientsFlags a
INNER JOIN Client b
ON a.clientId = b.id
WHERE b.emailRegistrationToken = 3 AND
a.flagId = 42;
试试这个
Delete C From ClientFlags cf, Client c where cf.lientId=c.Id and email=3 and flagId=42;
你应该尝试这样的事情:
DELETE C FROM ClientsFlags AS CF
JOIN Client AS C ON C.Id=CF.clientId
WHERE email=3 and flagId=42