两张表如下:
t1{f1[char],f2[int]} t2{f3[char],f1[char]}
A 6 X A
B 7 Y B
A 10 Z C结果:
X 16
Y 7
Z 0要求写出SQL语句得到如上结果。回答问题正确的人可以到这儿回帖领分:)
http://topic.csdn.net/u/20080304/12/bdcd299f-9d33-4b50-b461-3d04aa4e2f17.html由于时间紧迫,这儿人比较多,所以到这儿发帖,望斑竹高抬贵手~~~~~
解决方案 »
- 求名词解释
- 新手求救!vs2008中增加Flash控件出问题,在线等~~
- C#中方法引用C++结构体指针的问题
- 在catch块中throw new exception(string,exception)有什么意义?
- c#实现汉诺塔算法
- 菜人问菜鸟问题。
- 哪何把pictureBox1中的一部分图片拷贝到pictureBox2中去?
- 在c#.net中如何显示存在数据表中的照片?
- <param></param>注释是用那种软件生成的?
- 如何获取一个引用在app store的所有评论?
- 如何保护自己的软件?
- 在C#.net 2005中的DataGrid中 怎样给手工添加上去的ComboBoxColumn添加选项
(select sum(f2) from t1 where t1.f1=t2.f1) as f5
from t2
select t2.f3,
(select IsNull(sum(f2),0) from t1 where t1.f1=t2.f1) as f5
from t2
isnull((select sum(f2) from t1 where t1.f1=t2.f4),0) as f5
from t2