两个简单的表字段如下:
table1
studentid chinese
1001 56
1002 34
1003 22
table2
studentid chinese
1001 33
1002 66把两边相同的studentID的中文成绩相加studentid chinese
1001 89
1002 100
1003 22如两表中只要一表有的,要体现,如下table1中的1003
table1
studentid chinese
1001 56
1002 34
1003 22
table2
studentid chinese
1001 33
1002 66把两边相同的studentID的中文成绩相加studentid chinese
1001 89
1002 100
1003 22如两表中只要一表有的,要体现,如下table1中的1003
解决方案 »
- 如何打印DBGIRD中的内容,我用的是DELPHI7,对第三放控件不知如何使用 最好DELPHI7自带的控件 要有代码的解答 谢谢了
- 谁有delphi操作powerpoint的资料,望贡献一下
- 近来怎么常来的几个论坛,都出了日文的东东,是什么呀?偶又不认识,为什么不用中文,没有别的企图吧?
- 关于读取服务器的文件
- ie 插件
- 请问一句select
- 请hempweed过来接分
- <windows应用程序设计>这本书怎么样啊???
- 问一个小问题,马上给分。怎么指定当前屏保?50分赠送!
- 为什么要学VC++呢,
- dephi中的table 如何导出成外部dbf格式文件,请高手指点。。。。
- 求类似股票K线图的控件 100分
(select t1.studentid ,t1.chinese as a1,t2.chinese as a2 from table1 T1 left join table2 T2 on (T1.studentid =T2.studentid))
(select t1.studentid ,t1.chinese as a1,t2.chinese as a2 from table1 T1 left join table2 T2 on (T1.studentid =T2.studentid))
上面的兄弟写的得到的结果都是:
studentid chinese
1001 89
1002 100
1003
1003的数据没有了
FROM
(SELECT * FROM TABLE1
UNION ALL
SELECT * FROM TABLE2
) A
GROUP BY studentid
------------
ACCESS可以用iif 函數代替isnull
FROM
(SELECT * FROM TABLE1
UNION ALL
SELECT * FROM TABLE2
) A
GROUP BY studentid