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

前端之家收集整理的这篇文章主要介绍了oracle四表结合怎么查?(两条线)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

分享图片

一条线是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相关文章