这里是示例查询:
select email, firstName, lastName from users where createdAt between '2020-04-01 00:00:00.0' and '2020-09-30 23:59:59.0' or email like '%bob%' or firstName like '%bob%' or lastName like '%bob%' order by createdAt desc
例如,我得到的结果是:
[email protected],remi10,martin10 [email protected],Bobby,martin6 [email protected],Bob,martin5 [email protected],remi4,martin4
我正在尝试获取...
[email protected],Bobby,martin6 [email protected],Bob,martin5
应该在提供的日期/时间段之间返回具有
%bob%
的记录。
这里是示例查询:从'2020-04-01 00:00:00.0'和'2020-09-30 23:59:59.0'之间创建的用户中选择电子邮件,名字,姓氏或类似'%bob的电子邮件%'...
应该返回在提供的日期/时间段内具有%bob%的记录。
首先,我建议简化数据逻辑。其次,需要括号: