msyql查詢爲什麼我得到的MySQL結果列值dismatch
SELECT id,student_user_id,MIN(start_time) FROM appoint_course
WHERE student_user_id IN(
931,2034,2068,2111,2115,2173,2181,2285,2500,2505,2507,
2518,2594,2596,2600,2608,2637,2652,2654
)
AND course_type=3 and disabled=0 GROUP BY student_user_id;
結果 [查詢結果]
+-------+-----------------+-----------------+
| id | student_user_id | MIN(start_time) |
+-------+-----------------+-----------------+
| 8356 | 931 | 1500351000 |
| 9205 | 2034 | 1501733400 |
| 9246 | 2068 | 1501649100 |
| 9755 | 2111 | 1502943000 |
| 9585 | 2115 | 1502595300 |
| 10820 | 2173 | 1503545700 |
| 9594 | 2181 | 1502852400 |
| 10324 | 2285 | 1502852400 |
| 11204 | 2500 | 1504839600 |
| 11152 | 2507 | 1504064100 |
| 12480 | 2594 | 1505707800 |
| 11521 | 2608 | 1504494000 |
| 11818 | 2652 | 1504753200 |
+-------+-----------------+-----------------+
但正確的開始時間爲:
id: 9594
start_time: 1503284400
9594右START_TIME是1503284400沒有1502852400.In其實1502852400是9597 記錄,我不知道爲什麼。
你好湯姆。請閱讀[這](https://stackoverflow.com/help/how-to-ask)和改善你的問題,使人們可以來幫您吧。 – Jeffrey
你的問題還不清楚。請向我們展示樣本輸入數據和您期望的輸出。 –
START_TIME dismatch主要id.eg.right記錄:START_TIME:1,ID:1,但我得到START_TIME:1,ID:2 – Tom