ocp-047-27(已解决)

27. View the Exhibit and examine the structure of the PRODUCT_INFORMATION 
table.You want to see the product names and the date of expirat ion of warranty 
for all the products, if the product is purchased today. The products that 
have no warranty should be displayed at the top and the 
products with maximum warranty period should be displayed at the bottom. 
Which SQL statement would you execute to fulfill this requirement? 

查看表结构,如果是今天购买的,想要看到产品名,所有商品保修期,没有保修的排在顶端,最大保修日期的排在低端。



SQL> SELECT product_name, category_id, SYSDATE+warranty_period AS "Warranty

  2  expire date" FROM product_information
  3  ORDER BY SYSDATE+warranty_period
  4  ;
 
SELECT product_name, category_id, SYSDATE+warranty_period AS "Warranty
expire date" FROM product_information
ORDER BY SYSDATE+warranty_period
 

实验:

SQL> SELECT product_name, category_id, SYSDATE+warranty_period AS "Warranty expire date"
  2  FROM product_information
  3  ORDER BY SYSDATE+warranty_period
  4  ;
 
PRODUCT_NAME                                       CATEGORY_ID Warranty expire date
-------------------------------------------------- ----------- --------------------
Screws <S.32.S>                                             19 2013/8/1 15:32:08
Screws <Z.16.S>                                             19 2013/8/1 15:32:08
Screws <Z.24.S>                                             19 2013/8/1 15:32:08
Screws <Z.28.P>                                             19 2013/8/1 15:32:08
Base ISO CP - BL                                            29 2013/8/1 15:32:08
Client ISO CP - S                                           29 2013/8/1 15:32:08
OSI 8-16/IL                                                 29 2013/8/1 15:32:08
IC Browser Doc - S                                          29 2013/8/1 15:32:08
Client ISO CP - S                                           29 2013/8/1 15:32:08
Client ISO CP - V                                           29 2013/8/1 15:32:08
OSI 1-4/IL                                                  29 2013/8/1 15:32:08
MB - S900/650+                                              15 2013/8/1 15:32:08
WSP DA-130                                                  15 2013/8/1 15:32:08
WSP DA-290                                                  15 2013/8/1 15:32:08
Cable Connector - 32R                                       19 2013/8/1 15:32:08
Cable Harness                                               19 2013/8/1 15:32:08
Paper Tablet LW 8 1/2 x 11                                  32 2013/8/1 15:32:08
Pens - 10/FP                                                32 2013/8/1 15:32:08
Business Cards Box - 250                                    32 2013/8/1 15:32:08
Business Cards - 1000/2L                                    32 2013/8/1 15:32:08

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值