码迷,mamicode.com
首页 > 数据库 > 详细

oracle四表结合怎么查?(两条线)

时间:2018-07-01 14:52:38      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:item   last   show   分享   com   sele   creat   origin   recycle   

技术分享图片

一条线是item,para_value,feature;另外一条是 item,sku。

思考过程:先把item和sku表联合查出结果集,然后再把这个结果集当成一张表,最后与另外两张表结合查询。

select *
from (select min(es.sku_price) sku_price, ei.*
from eb_item ei, eb_sku es
where ei.item_id = es.item_id
and ei.audit_status = 1
and ei.show_status = 0
group by ei.ITEM_ID,
ei.ITEM_NAME,
ei.ITEM_NO,
ei.BRAND_ID,
ei.CAT_ID,
ei.TAG_IMG_ID,
ei.TAG_IMG,
ei.IS_NEW,
ei.IS_GOOD,
ei.IS_HOT,
ei.PROMOTION,
ei.AUDIT_STATUS,
ei.SHOW_STATUS,
ei.IMGS,
ei.KEYWORDS,
ei.PAGE_DESC,
ei.ITEM_RECYCLE,
ei.ON_SALE_TIME,
ei.CHECK_TIME,
ei.UPDATE_TIME,
ei.UPDATE_USER_ID,
ei.CREATE_TIME,
ei.CHECKER_USER_ID,
ei.FULL_PATH_DEPLOY,
ei.FULL_PATH_DEPLOY_OFFER,
ei.ORIGINAL_ITEM_ID,
ei.LAST_STATUS,
ei.MERCHANT_ID,
ei.ITEM_SORT,
ei.SALES,
ei.CREATE_USER_ID,
ei.SIM_LEVEL,
ei.GIFT_DESC,
ei.GIFT_IMG,
ei.GIFT_SHOW_TYPE,
ei.IMG_SIZE1) e1,
eb_para_value ev,
eb_feature ef
where e1.item_id = ev.item_id
and ev.feature_id = ef.feature_id
and ef.is_select = 1

oracle四表结合怎么查?(两条线)

标签:item   last   show   分享   com   sele   creat   origin   recycle   

原文地址:https://www.cnblogs.com/Each-Person-Got-a-Dream/p/9250006.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!