sql请教 - MS-SQL Server / 疑难问题
有两张表产品表product,销售表proout
--------
产品表product
prono proname price
00001 电视 3000.00
00002 空调 2000.00
00003 床 1000.00
00004 餐桌 1500.00
00005 音响 5000.00
00006 沙发 6000.00
销售表proout
saledate cusno prono quantity
2002-01-01 00:00:00.000 001 00001 10
2002-01-01 00:00:00.000 001 00002 5
2002-01-01 00:00:00.000 002 00001 5
2002-01-01 00:00:00.000 002 00003 10
2002-01-02 00:00:00.000 001 00001 10
2002-01-02 00:00:00.000 001 00003 20
2002-01-02 00:00:00.000 001 00001 10
2002-01-02 00:00:00.000 003 00004 30
2002-01-03 00:00:00.000 003 00004 10
prono为外键
写一段sql要求显示销售金额在10万元以下的产品清单?????????
这返回所有的查询
select m.proname 产品名, sum(n.quantity) 销售量 ,
sum(m.price) 销售金额 from product m , proout n
where m.prono = n.prono
group by m.proname
SQL code:
select * from
(
select m.proname 产品名, sum(n.quantity) 销售量 ,
sum(m.price) 销售金额 from product m , proout n
where m.prono = n.prono
group by m.proname
)t
where
销售金额<100000
SQL code:
----
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......
请问
添加新数据源->数据库->添加连接
这个界面下,数据源选择:Microsoft SQL Server (SqlClient);
服务器名:
应该写什么呢?
有谁知道?多谢各位!!
你到底是要连mysql还是mssql?
引用
请问
......
运行后报错误如下:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 '数学 + 4where 姓名='王静'' 中。
......
下面是XML初始文件内容
XML code:
<upd:Update xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/Up ......