客户表(A):
aid aname
1 abc
2 efg
3 hij
定单表(B):
bid aid
1 1
2 1
3 2
4 2
5 3
产品表(C):
cid cdj(产品单价) cnum(定购数量) bid
1 1000 10 1
2 500 2 2
3 2800 15 3
4 3000 2 4
5 520 10 2
6 720 9 1问题如下:
查出每个客户的编号、客户名以及总定单金额??
请哪位大虾帮忙解决一下,小弟在这先谢了!!!
aid aname
1 abc
2 efg
3 hij
定单表(B):
bid aid
1 1
2 1
3 2
4 2
5 3
产品表(C):
cid cdj(产品单价) cnum(定购数量) bid
1 1000 10 1
2 500 2 2
3 2800 15 3
4 3000 2 4
5 520 10 2
6 720 9 1问题如下:
查出每个客户的编号、客户名以及总定单金额??
请哪位大虾帮忙解决一下,小弟在这先谢了!!!
解决方案 »
- java语言下 非泛型类 泛型方法中得到 T的类别
- 用JAVA写一个上传文件的代码
- 关于贪婪算法和IO操作的两个问题
- 关于Spring的注入简化问题
- 求助一份电梯仿真系统代码
- hibernate的MappingException
- 在jboss中部署MDB;测试时可以接收消息,但接收完消息后jboss服务器显示如下异常,是什么原因?:WARN [OILServerILService] Connection
- JBuilder+weblogic开发j2ee的爱好者,请留下您的联系方式!谢谢,让我们共同进步!
- xuetinge(薛挺) 进来领分!
- 正在做基于J2ee的物流系统,有一问题想请教?
- 再次请求下Struts2类型转换问题,请高手帮忙看看。
- java高手解决
create table a
(
aid int primary key identity(1,1),
name varchar(20)
)
insert into a
select 'abc' union all
select 'efg' union all
select 'hij'
create table b
(
bid int primary key identity(1,1),
aid int
)
insert into b
select 1 union all
select 1 union all
select 2 union all
select 2 union all
select 3
create table c
(
cid int primary key identity(1,1),
price int,
quantity int,
bid int
)
insert into c
select 1000,10,1 union all
select 500,2,2 union all
select 2800,15,3 union all
select 3000,2,4 union all
select 520,10,2 union all
select 720,9,1select a.aid,min(a.name) as name ,isnull(sum(c.price*c.quantity),0) as total
from a left join b on b.aid = a.aid
left join c on c.bid = b.bid
group by a.aid
只是我想问的是用Hibernate怎么写HQL语句呢??
关系我也已经映射好了!!
待求高人解答????