【发布时间】:2018-08-30 18:28:40
【问题描述】:
抱歉标题不好,但我不知道如何更好地描述它。
我有 3 张桌子
1.) 竞赛
ID Title
----------
1 Contest 1
2 Contest 2
3 Contest 3
2.) 竞赛系列
ID contest_id series_id
----------------------------
1 1 3
2 1 2
3 2 1
4 2 2
5 3 3
3.) 系列
ID start_date
----------------
1 2018-03-21 14:00:00
2 2018-03-21 15:00:00
3 2018-03-21 16:00:00
现在我尝试实现的是,获取按比赛中第一个起始系列的 start_date 排序的比赛列表。
想要的结果:
contest_id start_date_of_first_series
------------------------
2 2018-03-21 14:00:00
1 2018-03-21 15:00:00
3 2018-03-21 16:00:00
重要提示:结果中的contest_id需要不同。
【问题讨论】:
标签: mysql sql join sql-order-by