select top 10 * from calls_item_package where 1=1 and parentNo = 'UU1501467168003' and orderPlan = '1' and (datediff(HH ,limtDate,getdate())<=6 or limtDate is null) and status != 2 and itemid not in (select top 0 itemid from calls_item_package where 1=1 and parentNo = 'UU1501467168003' and orderPlan = 1 and (datediff(HH ,limtDate,getdate())<=6 or limtDate is null) and status != 2 order by dataPriority desc,level desc ) order by dataPriority desc,level desc

有 or 的时候必须使用括号括起来,不然就会出错啦

相关文章:

  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-01-05
  • 2021-11-15
相关资源
相似解决方案