SQL数据库 字段C去重 同时取字段A最大值
数据表如下ABCDgoodscostidgoodsidshopidcost356132646C00444.9415402032646C00444.94427132647C...
数据表如下
A B C D
goodscostid goodsid shopid cost
3561 32646 C004 44.94
154020 32646 C004 44.94
4271 32647 C009 67.08
249738 32646 C004 44.94
438620 32646 C004 44.94
4725 32646 C008 44.94
4287 38759 C004 50.00
4270 32646 C009 44.94
352018 32646 C009 44.94
46848 32646 C010 44.94
4287 32680 C009 17.12
4287 73075 C014 56.55
140384 32646 C010 44.94
369619 32646 C010 44.94
4289 38762 C004 43.00
4270 32646 C009 44.94
我想通过一条语句 实现查询结果如下:
A B C D
goodscostid goodsid shopid cost
438620 32646 C004 44.9400
4725 32646 C008 44.9400
352018 32646 C009 44.9400
369619 32646 C010 44.9400
条件:字段A最大值 字段B32646 字段C去重 显示A,B,C,D
求大牛出代码! 展开
A B C D
goodscostid goodsid shopid cost
3561 32646 C004 44.94
154020 32646 C004 44.94
4271 32647 C009 67.08
249738 32646 C004 44.94
438620 32646 C004 44.94
4725 32646 C008 44.94
4287 38759 C004 50.00
4270 32646 C009 44.94
352018 32646 C009 44.94
46848 32646 C010 44.94
4287 32680 C009 17.12
4287 73075 C014 56.55
140384 32646 C010 44.94
369619 32646 C010 44.94
4289 38762 C004 43.00
4270 32646 C009 44.94
我想通过一条语句 实现查询结果如下:
A B C D
goodscostid goodsid shopid cost
438620 32646 C004 44.9400
4725 32646 C008 44.9400
352018 32646 C009 44.9400
369619 32646 C010 44.9400
条件:字段A最大值 字段B32646 字段C去重 显示A,B,C,D
求大牛出代码! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |