SELECT COUNT(1) FROM ZFS_OP.OP_EFS_PAYMENT WHERE GROUP_ID='35f1594c-6139-4b8e-9d19-a6d42d579e0c' AND PAYMENT_STATUS=30 AND ARCHIVE_DATE AND ENABLED_FLAG=0 AND VALIDITY_FLAG=0 AND ON_OFF_LINE=0b补充sql,写三个sql,ARCHIVE_DATE条件是本年,本月,本日
时间: 2023-11-24 12:05:19 浏览: 89
补充 SQL:
1. 本年:
```
SELECT COUNT(1) FROM ZFS_OP.OP_EFS_PAYMENT
WHERE GROUP_ID='35f1594c-6139-4b8e-9d19-a6d42d579e0c'
AND PAYMENT_STATUS=30
AND ARCHIVE_DATE >= DATE_FORMAT(NOW(),'%Y-01-01')
AND ARCHIVE_DATE <= DATE_FORMAT(NOW(),'%Y-12-31')
AND ENABLED_FLAG=0
AND VALIDITY_FLAG=0
AND ON_OFF_LINE=0;
```
2. 本月:
```
SELECT COUNT(1) FROM ZFS_OP.OP_EFS_PAYMENT
WHERE GROUP_ID='35f1594c-6139-4b8e-9d19-a6d42d579e0c'
AND PAYMENT_STATUS=30
AND ARCHIVE_DATE >= DATE_FORMAT(NOW(),'%Y-%m-01')
AND ARCHIVE_DATE <= LAST_DAY(NOW())
AND ENABLED_FLAG=0
AND VALIDITY_FLAG=0
AND ON_OFF_LINE=0;
```
3. 本日:
```
SELECT COUNT(1) FROM ZFS_OP.OP_EFS_PAYMENT
WHERE GROUP_ID='35f1594c-6139-4b8e-9d19-a6d42d579e0c'
AND PAYMENT_STATUS=30
AND ARCHIVE_DATE >= DATE_FORMAT(NOW(),'%Y-%m-%d')
AND ARCHIVE_DATE <= DATE_FORMAT(NOW(),'%Y-%m-%d')
AND ENABLED_FLAG=0
AND VALIDITY_FLAG=0
AND ON_OFF_LINE=0;
```
注意:以上 SQL 仅供参考,具体需要根据实际情况进行调整。
阅读全文