SELECT * FROM t_cashflow WHERE DATE(SELECT cash_ctime FROM t_cashflow WHERE cash_money = 200 and driver_id = 1 and cash_direction = 2 ) = CURDATE();
时间: 2024-03-08 11:49:43 浏览: 58
CASHFLOW CCTALK 8052 .rar_8051_cashflow_cctalk
这个 SQL 语句的语法是错误的,应该使用以下语句:
```sql
SELECT * FROM t_cashflow
WHERE DATE(cash_ctime) = CURDATE()
AND cash_money = 200
AND driver_id = 1
AND cash_direction = 2;
```
这个语句会查询 `t_cashflow` 表中所有 `cash_ctime` 为今天的记录,且 `cash_money` 为 200、`driver_id` 为 1、`cash_direction` 为 2 的记录。你可以根据需要修改查询条件和返回字段,例如:
```sql
SELECT cash_id, cash_money, cash_ctime
FROM t_cashflow
WHERE DATE(cash_ctime) = CURDATE()
AND cash_money = 200
AND driver_id = 1
AND cash_direction = 2;
```
这个语句只返回 `cash_id`、`cash_money` 和 `cash_ctime` 字段的值。
阅读全文