主题:求SQL语句,关于关联与插入的,请大家不吝赐教!
表A
Km dm
采油一矿 1队
采油一矿 2队
采油二矿 3队
采油二矿 4队
采油三矿 5队
采油三矿 6队
采油四矿 7队
采油四矿 8队
表B
Km Dm Rq lrsj
采油一矿 1队 2006-8-4 2006-8-4 9:36:37
采油二矿 3队 2006-8-4 2006-8-4 9:36:37
采油三矿 5队 2006-8-4 2006-8-4 9:36:37
采油四矿 7队 2006-8-4 2006-8-4 9:36:37
采油一矿 1队 2006-8-3 2006-8-3 9:36:37
采油一矿 2队 2006-8-3 2006-8-3 9:36:37
采油二矿 3队 2006-8-3 2006-8-3 9:36:37
采油二矿 4队 2006-8-3 2006-8-3 9:36:37
采油三矿 5队 2006-8-3 2006-8-3 9:36:37
采油三矿 6队 2006-8-3 2006-8-3 9:36:37
采油四矿 7队 2006-8-3 2006-8-3 9:36:37
采油四矿 8队 2006-8-3 2006-8-3 9:36:37
其中表A数据不变 ,表B每天有新数据
要得到的表C
Km Dm Rq lrsj
采油一矿 1队 2006-8-4 2006-8-4 9:36:37
采油一矿 2队 2006-8-4 暂无数据
采油二矿 3队 2006-8-4 2006-8-4 9:36:37
采油二矿 4队 2006-8-4 暂无数据
采油三矿 5队 2006-8-4 2006-8-4 9:36:37
采油三矿 6队 2006-8-4 暂无数据
采油四矿 7队 2006-8-4 2006-8-4 9:36:37
采油四矿 8队 2006-8-4 暂无数据
采油一矿 1队 2006-8-3 2006-8-3 9:36:37
采油一矿 2队 2006-8-3 2006-8-3 9:36:37
采油二矿 3队 2006-8-3 2006-8-3 9:36:37
采油二矿 4队 2006-8-3 2006-8-3 9:36:37
采油三矿 5队 2006-8-3 2006-8-3 9:36:37
采油三矿 6队 2006-8-3 2006-8-3 9:36:37
采油四矿 7队 2006-8-3 2006-8-3 9:36:37
采油四矿 8队 2006-8-3 2006-8-3 9:36:37
现在我只得到了如下表
Km Dm Rq lrsj
采油一矿 1队 2006-8-4 2006-8-4 9:36:37
采油二矿 3队 2006-8-4 2006-8-4 9:36:37
采油三矿 5队 2006-8-4 2006-8-4 9:36:37
采油四矿 7队 2006-8-4 2006-8-4 9:36:37
采油一矿 1队 2006-8-3 2006-8-3 9:36:37
采油一矿 2队 2006-8-3 2006-8-3 9:36:37
采油二矿 3队 2006-8-3 2006-8-3 9:36:37
采油二矿 4队 2006-8-3 2006-8-3 9:36:37
采油三矿 5队 2006-8-3 2006-8-3 9:36:37
采油三矿 6队 2006-8-3 2006-8-3 9:36:37
采油四矿 7队 2006-8-3 2006-8-3 9:36:37
采油四矿 8队 2006-8-3 2006-8-3 9:36:37
那些暂无数据的该怎么取得?请大家不吝赐教!谢谢!!
Km dm
采油一矿 1队
采油一矿 2队
采油二矿 3队
采油二矿 4队
采油三矿 5队
采油三矿 6队
采油四矿 7队
采油四矿 8队
表B
Km Dm Rq lrsj
采油一矿 1队 2006-8-4 2006-8-4 9:36:37
采油二矿 3队 2006-8-4 2006-8-4 9:36:37
采油三矿 5队 2006-8-4 2006-8-4 9:36:37
采油四矿 7队 2006-8-4 2006-8-4 9:36:37
采油一矿 1队 2006-8-3 2006-8-3 9:36:37
采油一矿 2队 2006-8-3 2006-8-3 9:36:37
采油二矿 3队 2006-8-3 2006-8-3 9:36:37
采油二矿 4队 2006-8-3 2006-8-3 9:36:37
采油三矿 5队 2006-8-3 2006-8-3 9:36:37
采油三矿 6队 2006-8-3 2006-8-3 9:36:37
采油四矿 7队 2006-8-3 2006-8-3 9:36:37
采油四矿 8队 2006-8-3 2006-8-3 9:36:37
其中表A数据不变 ,表B每天有新数据
要得到的表C
Km Dm Rq lrsj
采油一矿 1队 2006-8-4 2006-8-4 9:36:37
采油一矿 2队 2006-8-4 暂无数据
采油二矿 3队 2006-8-4 2006-8-4 9:36:37
采油二矿 4队 2006-8-4 暂无数据
采油三矿 5队 2006-8-4 2006-8-4 9:36:37
采油三矿 6队 2006-8-4 暂无数据
采油四矿 7队 2006-8-4 2006-8-4 9:36:37
采油四矿 8队 2006-8-4 暂无数据
采油一矿 1队 2006-8-3 2006-8-3 9:36:37
采油一矿 2队 2006-8-3 2006-8-3 9:36:37
采油二矿 3队 2006-8-3 2006-8-3 9:36:37
采油二矿 4队 2006-8-3 2006-8-3 9:36:37
采油三矿 5队 2006-8-3 2006-8-3 9:36:37
采油三矿 6队 2006-8-3 2006-8-3 9:36:37
采油四矿 7队 2006-8-3 2006-8-3 9:36:37
采油四矿 8队 2006-8-3 2006-8-3 9:36:37
现在我只得到了如下表
Km Dm Rq lrsj
采油一矿 1队 2006-8-4 2006-8-4 9:36:37
采油二矿 3队 2006-8-4 2006-8-4 9:36:37
采油三矿 5队 2006-8-4 2006-8-4 9:36:37
采油四矿 7队 2006-8-4 2006-8-4 9:36:37
采油一矿 1队 2006-8-3 2006-8-3 9:36:37
采油一矿 2队 2006-8-3 2006-8-3 9:36:37
采油二矿 3队 2006-8-3 2006-8-3 9:36:37
采油二矿 4队 2006-8-3 2006-8-3 9:36:37
采油三矿 5队 2006-8-3 2006-8-3 9:36:37
采油三矿 6队 2006-8-3 2006-8-3 9:36:37
采油四矿 7队 2006-8-3 2006-8-3 9:36:37
采油四矿 8队 2006-8-3 2006-8-3 9:36:37
那些暂无数据的该怎么取得?请大家不吝赐教!谢谢!!