求一条sql语句 根据时间time 和 状态state查询订单order
答案:4 悬赏:20
解决时间 2021-02-18 04:28
- 提问者网友:堕落的邪教徒
- 2021-02-17 05:41
查询time>5state=1和time<=5state!=1的订单,用一条sql语句写出来
最佳答案
- 二级知识专家网友:丢不掉的轻狂
- 2021-02-17 07:03
select * from table A
where (A.time > 5 and A.state = 1)
or (A.time <= 5 and A.state <> 1)
where (A.time > 5 and A.state = 1)
or (A.time <= 5 and A.state <> 1)
全部回答
- 1楼网友:孤伤未赏
- 2021-02-17 11:29
你好!
select * from 订单表 where( time>5 and state=1)or(time<=5 and state<>1)
打字不易,采纳哦!
- 2楼网友:最后战士
- 2021-02-17 09:52
select * from tablename
where (time > 5 and state = 1) or (time <= 5 and state <> 1)
- 3楼网友:狠傷凤凰
- 2021-02-17 08:12
select * from 表
where (time > 5 and state = 1) or (time <= 5 and state <> 1)
如果要跟当前时间比较,还要转换当前时间
datepart(time,getdate()) as varchar(2))
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯