销售前10的mysql_如何用sql语句将销量排名前十的商品查询

展开全部

1、创建测试表,

create table test_sale(id varchar2(20),sale_num number(10));

02fd0b13f15b78ef90e2910fee6ab983.png

2、插入测试数据;

insert into test_sale values('goods_1',15);

insert into test_sale values('goods_2',125);

insert into test_sale values('goods_3',28);

insert into test_sale values('goods_4',36);

insert into test_sale values('goods_5',72);

insert into test_sale values('goods_6',85);

insert into test_sale values('goods_7',99);

insert into test_sale values('goods_8',100);

insert into test_sale values('goods_9',102);

insert into test_sale values('goods_10',35);

commit;


版权声明:本文为weixin_39849070原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。