大家好,我对一个 SQL 查询有问题,我找不到解决办法。
在我的数据库里,我有两个表格, Mytable1 和 Mytable2, Mytable1 包含 idCalendar 列、 idPlayer 、 datePlaying 和 Mytable2 包含 idPlayer 和 namePlayer 。
我想在Mytable1中提取每个日期的未玩耍的玩家的名字。
For example Mytable1 (contains player and playing date):
idCalendar|idPlayer|datePlaying
1 | 1 | 05/01/2012
2 | 2 | 06/01/2012
3 | 3 | 08/01/2012
4 | 2 | 05/01/2012
Myable2( 包含所有玩家名称) :
idPlayer|namePlayer
1 | P1
2 | P2
3 | P3
4 | P4
我想创建一个显示以下结果的视图 :
ViewResult( 尚未按日期播放的玩家) :
datePlaying | playerName
05/01/2012 | P2
05/01/2012 | P3
06/01/2012 | P1
06/01/2012 | P3
08/01/2012 | P1
08/01/2012 | P2
As you can see I need result with this information: - in 05/01/2012 P2 and P3 haven t played. - in 06/01/2012 P1 and P3 haven t played. - in 08/01/2012 P1 and P2 haven t played.
我希望我说得够清楚了 事先谢谢你