如何编写指令 if
,它将检查同时存储的记录(在我的表中是列 created_at
)。
例如:
if(created_at for record where key(it's column)='stan' it is the same as created_at for key='stan_key' {
return records where key='stan'
}
最佳答案
有几个选项。这是使用 exists
的版本:
select *
from yourtable y1
where y1.key = 'stan' and exists (
select 1
from yourtable y2
where y2.key = 'stan_key' and y1.created_at = y2.created_at)
关于php - if 检查双重记录的条件指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38573303/