我正在尝试查询SQL Compact
基本上是这些查询,但我希望我可以将它们合并为一个。
1.
SELECT schoolId,opponent
FROM TEAM_SCHEDULE
WHERE seasonId = " & i & "
AND gameid = " & currentGame & "
ORDER BY id"
These are variables, trying to eliminate them at some point
currentMatch(0) = schoolId
currentMatch(1) = opponent
2.
SELECT id
FROM player
WHERE school = " & currentMatch(0) & "
AND starter = 'TRUE'
AND game_id = " & currentGame & "
ORDER BY weight
3.
SELECT id
FROM player
WHERE school = " & currentMatch(1) & "
AND starter = 'TRUE'
AND game_id = " & currentGame & "
ORDER BY weight
我在想我可以做这样的事情,但我遇到了一个问题,试图弄清楚如何将这两个学校添加到查询中。
cmd.CommandText = "SELECT b.id, player.id" &
" FROM player b" &
" WHERE player.school = " & currentMatch(0) &
" OR player.school = " & currentMatch(1) &
" INNER JOIN player" &
" ON b.weight = player.weight" &
" ORDER BY player.weight"
为了希望消除任何困惑,我正在尝试:
- 从 team_schedule、schoolId 和对手中选择 2 个学校(int)。
- 从这两所学校中选择每个权重的所有初学者('True')。
- 根据体重将每所学校的首发球员配对。
- 能够选择每一对并操作数据。
感谢任何帮助!
这是来自您的查询 Nikola 的解析错误,