mysql 连接 2 列进行排序

发布于 2024-12-09 04:19:07 字数 208 浏览 3 评论 0原文

与某事进行真正的斗争。我有一个包含以下内容的灯具列表:

主队、客队、日期、时间、赛季、比赛。

我希望能够加入/分组主队和客队,这样我就可以据此对我的结果进行分组。所以基本上我每支球队只会获得一场比赛。显然,在我以某种方式将主队和客队加入为一列之前,我无法做到这一点。

我有什么想法如何做到这一点?

Having a real struggle with something. I have a list of fixtures that have the following:

hometeam, awayteam, date, time, season, competition.

I want to be able to join/group hometeam and awayteam so I can then group my results by this. So basically I would only get one fixture per team. I obviously cant do this until I have somehow joined hometeam and away team as one column.

Any ideas how I would do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花辞树 2024-12-16 04:19:08

尝试使用 CONCAT() 函数:

SELECT CONCAT(hometeam, '-', awayteam) as fixture
     , date, time, season, competition
  FROM teams
 GROUP BY fixture

Try using the CONCAT() function:

SELECT CONCAT(hometeam, '-', awayteam) as fixture
     , date, time, season, competition
  FROM teams
 GROUP BY fixture
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文