SELECT `o`.`id`,`o`.`pay_type`,`o`.`operation_id`,`o`.`order_no` FROM `pay_auth_log` `o` WHERE `o`.`status` < 99 AND `pay_status` <= 1;
这条语句怎么改为,当pay_type=2 && operation_id
为空的时候就过滤改条信息,但是pay_type=1
时,operation_id
为空时,该记录需要展示出来。
1
eason1874 2021-01-23 17:33:40 +08:00 1
`pay_type` = 1 OR (`pay_type` = 2 AND `operation_id` IS NOT NULL)
|
2
easonzhang666 2021-01-23 17:37:28 +08:00
and ((xx ) or (xx))
|
3
cs5117155 OP good
|
4
deargodfrey 2021-01-23 18:06:42 +08:00 via Android
mysql 能用 not 吗如果有的话就只要加个 AND NOT (paytype=2 and operationid is null)
|
5
cs5117155 OP @deargodfrey 这个也不错
|