我有疑问:
Insert into target_counts
(target_id, email)
values (111, 'aa@aa.aa')
ON DUPLICATE KEY UPDATE
updated = NOW(),
ref_count= (SELECT Count(DISTINCT t.id)
FROM targets t
INNER join some_other_table sot on sot.target_id = t.id
sot.email = VALUES(email)
)
但是有错误 'Unknown column 'email' in 'on clause''
是否有可能在重复键子查询中使用值?
暂无答案!
目前还没有任何答案,快来回答吧!