select s.*,p.*,pic.* from SHOPPING_CART s,PRODUCTS p,PRODUCT_PIC pic where s.PRODUCT_ID = p.PRODUCT_ID and s.PRODUCT_ID = pic.PRODUCT_ID and s.MEMBER_NAME = 用户账号
select s.*, p.*, pic.*
from SHOPPING_CART s
inner join PRODUCTS p on s.PRODUCT_ID = p.PRODUCT_ID
inner join (select ID, PRODUCT_ID, SRC
from (select row_number() over(partition by PRODUCT_ID order by id) as rn,
PRODUCT_PIC.*
from PRODUCT_PIC)
where rn = 1) pic on s.PRODUCT_ID = pic.PRODUCT_ID
where s.MEMBER_NAME = 用户账号 ------解决方案-------------------- “over(partition by PRODUCT_ID order by id” 意思是按PRODUCT_ID分级,再按id排序