错误:select t from user t where t.endDate-t.startDate=1
正确:select t from user t where t.endDate=t.startDate+1
正确:select t from user t where t.endDate=t.startDate+1
本文介绍了一个常见的SQL查询错误,即使用不正确的日期间隔进行记录筛选,并给出了正确的查询方式。通过对比 endDate 和 startDate 的正确关系,确保了数据的有效性和准确性。
2907

被折叠的 条评论
为什么被折叠?