互いに上書きしないように、内部結合とエイリアス値を内部で実行する方法を知っている人はいますか? 私のコードを見ると、より明確に見えるかもしれません:
SELECT home, away, g.network, g.date_start
FROM game g
INNER JOIN team t ON (
(t.importid = g.home) as home
OR
(t.importid = g.away) as away
)
ORDER BY date_start DESC
LIMIT 7
解決済み(以下のヘルプの後、ここに私の最後のクエリがあります)
SELECT
home.market AS home_market,
away.market AS away_market,
g.network,
g.date_start
FROM game AS g
INNER JOIN team AS home ON (
home.importid = g.home
)
INNER JOIN team AS away ON (
away.importid = g.away
)
ORDER BY g.date_start DESC
LIMIT 7