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

6.1.2,没有测出你的问题,我这查询是正常的。


TiDB root@10.18.13.224:test> 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
Time: 0.139s
TiDB root@10.18.13.224:test> 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
Time: 0.094s
TiDB root@10.18.13.224:test> select version();
+--------------------+
| version()          |
+--------------------+
| 5.7.25-TiDB-v6.1.2 |
+--------------------+
1 row in set
Time: 0.022s
TiDB root@10.18.13.224:test>