oracle 多表查询去重的问题
请问这个sql怎么优化才能把重复的数据去掉。SELECT"shop_goods"."id","C"."name","shop_goods"."goods_sn"FROM"...
请问这个sql怎么优化才能把重复的数据去掉。
SELECT "shop_goods"."id", "C"."name", "shop_goods"."goods_sn" FROM "shop_goods"INNER JOIN "goods_details" "B"ON "shop_goods"."goods_sn" = "B"."sn"INNER JOIN "goods" "C"ON "B"."sn_style" = "C"."sn_style"WHERE "shop_goods"."goods_sn" IN('11019136027980','21075991861779'); 展开
SELECT "shop_goods"."id", "C"."name", "shop_goods"."goods_sn" FROM "shop_goods"INNER JOIN "goods_details" "B"ON "shop_goods"."goods_sn" = "B"."sn"INNER JOIN "goods" "C"ON "B"."sn_style" = "C"."sn_style"WHERE "shop_goods"."goods_sn" IN('11019136027980','21075991861779'); 展开
3个回答
展开全部
你这个不算重复,毕竟前面的shop_goods.id不一样。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你可以 group by name 取最大或最小的goods_sn
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你这个哪里重复了啊???name前面有编号啊??
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询