Select * From zm Where Sfzh In (Select Sfzh From zm; Group By Sfzh Having Count(*)>1) where sj<sj-300 ; Order By Sfzh asc; into cursor sql_jl READWRITE
字段为 sj,xm,sfzh
是这样的吗?
试试:
newsfzh=新增记录身份证号码
newsj=新增记录的时间
SELECT max(sj) FROM zm WHERE alltr(sfzh)=newsfzh INTO ARRAY lostsj
if type(lostsj)=.T.&&筛选出相同身份证号码的记录 if newsj-max_sj>300 与上次的记录时间超过5分钟,添加新记录 endif
else 无上次的记录,直接添加新记录
endif