下面在sh_goods表中根据cat_id升序排序,当cat_id相同时按price降序排序的语句是()。
A: SELECT * FROM sh_goods ORDER BY price DESC,cat_id;
B: SELECT * FROM sh_goods ORDER BY price ,cat_id;
C: SELECT * FROM sh_goods ORDER BY cat_id DESC,price;
D: SELECT * FROM sh_goods ORDER BY cat_id,price DESC;
A: SELECT * FROM sh_goods ORDER BY price DESC,cat_id;
B: SELECT * FROM sh_goods ORDER BY price ,cat_id;
C: SELECT * FROM sh_goods ORDER BY cat_id DESC,price;
D: SELECT * FROM sh_goods ORDER BY cat_id,price DESC;
举一反三
- 下面在sh_goods表中根据cat_id升序排序,并对每个cat_id按price降序排序的语句是( )。[br][/br](1.0) A: SELECT * FROM sh_goods ORDER BY price DESC,cat_id; B: SELECT * FROM sh_goods ORDER BY cat_id,price DESC; C: SELECT * FROM sh_goods ORDER BY price ,cat_id; D: SELECT * FROM sh_goods ORDER BY cat_id DESC,price;
- 查询主键id从高到低排序的前10条记录的语句是() A: SELECT * FROM table ORDER BY id ASC limit 1,10 B: SELECT * FROM table ORDER id DESC limit 10 C: SELECT * FROM table ORDER BY id DESC limit 10 D: SELECT * FROM table ORDER id ASC limit 1,10
- 输出公司的名称及id,以id的升序排列 A: SELECT name, id FROM job ORDER BY id ASC; B: SELECT name, id FROM job ORDER BY id DESC; C: SELECT name, id FROM job ORDER BY name DECS; D: SELECT name, id FROM job ORDER BY name ASC;
- 有表song(id,song_name,album,play_count,fav_count)分别表示歌曲的主键id、歌曲名、专辑名、播放次数和收藏次数,以下与order by相关的sql错误的是: A: select * from song order by play_count asc; B: select * from song order by (play_count + fav_count) asc; C: select * from song order by fav_count desc where play_count > 5; D: select * from song order by id,play_count asc,fav_count desc;
- 下面的SQL查询语句中的排序方法是( )。 SELECT * FROM tb_student order by id,age desc;