oracle数据库:数据的查询之二
时间:2014-04-15 12:27 来源: 我爱IT技术网 作者:微风
一、任务
二、脚本
16\select tm.uiid,tm.sum(omid),tm.sum(oamount),tu.uname from t_main_order tm,t_user tu where to_char(odate,'yyyy-mm')='2010-07' and tm.uiid=tu.uiid group by uiid having sum(oamount)>200;
16、在以上结果中附加显示用户名称
17、查询显示有折扣的商品信息,要求显示商品名称、商品类型名、商品单价、折扣、库存
18、查询商品领带采购总量
19、查询显示采购单信息,要求显示采购单号、采购日期、供应商名称、总金额、状态(1显示待审核,2显示已审核)
20、查询年龄最小的用户二、脚本
16\select tm.uiid,tm.sum(omid),tm.sum(oamount),tu.uname from t_main_order tm,t_user tu where to_char(odate,'yyyy-mm')='2010-07' and tm.uiid=tu.uiid group by uiid having sum(oamount)>200;
17\select tg.gname,tt.gtname,tg.gprice,tg.gdiscount,tg.gstocks from t_goods tg,t_type tt where tg.gtid=tt.gtid;
18\select sum(pinum) from t_procure_items tp,t_goods tg where tp.gid=tg.gid and tg.gname='领带';
19\select tm.pmid,tm.pdate,ts.sname,tm.pamount,decode(pstate,'1','待审核','2','已审核') from t_main_procure tm,t_supplier ts where tm.sid=ts.sid(+);
20\select uiid,uname,ubirthday from t_user where ubirthday=(select max(ubirthday) from t_user);
三、相关
7月1日,记:说起来容易,做起来难。原来学的就不精,现在要用发现基本上还给老师了。
还是一如既往的讨厌开会,特别是参加这种要穿工作服却连我的姓都改了的会,看着文件上的zhai某某,半天没反应过来,这人我认识吗?
在睁开眼睛的这段时间做自己喜欢的事——原来也是奢侈品...
A good laugh and a long sleep are the best cures in the doctor's book.
三、相关
7月1日,记:说起来容易,做起来难。原来学的就不精,现在要用发现基本上还给老师了。
还是一如既往的讨厌开会,特别是参加这种要穿工作服却连我的姓都改了的会,看着文件上的zhai某某,半天没反应过来,这人我认识吗?
在睁开眼睛的这段时间做自己喜欢的事——原来也是奢侈品...
A good laugh and a long sleep are the best cures in the doctor's book.
本文来源 我爱IT技术网 http://www.52ij.com/jishu/5061.html 转载请保留链接。
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
