同样的查询条件,展示字段不同,得出来结果不一样。

MySQL [sbtest]> SELECT VERSION();
±-------------------+
| VERSION() |
±-------------------+
| 5.7.25-TiDB-v5.4.3 |
±-------------------+
1 row in set (0.00 sec)

MySQL [sbtest]> SELECT
→ c.occur_amount
→ FROM capital_history c
→ JOIN txn_account_info t
→ ON c.txt_account_id=t.txn_account_id
→ AND c.capital_sub_class=‘CUST’
→ AND t.account_id=‘1142927’ AND t.broker=‘0009’
→ AND c.occur_trade_date = ‘2022-11-17’;
±-------------+
| occur_amount |
±-------------+
| -2.01 |
±-------------+
1 row in set (0.03 sec)

MySQL [sbtest]> SELECT
→ c.serial_id, c.occur_amount
→ FROM capital_history c
→ JOIN txn_account_info t
→ ON c.txt_account_id=t.txn_account_id
→ AND c.capital_sub_class=‘CUST’
→ AND t.account_id=‘1142927’ AND t.broker=‘0009’
→ AND c.occur_trade_date = ‘2022-11-17’;
±-----------------±-------------+
| serial_id | occur_amount |
±-----------------±-------------+
| 2022111700196920 | -2.01 |
±-----------------±-------------+
1 row in set (0.02 sec)

MySQL [sbtest]>
我这也没问题。。。