题解 | 将查询后的列重新命名
将查询后的列重新命名
https://www.nowcoder.com/practice/0d8f49aeaf7a4e1cb7fecec980712113
SELECT device_id AS user_infos_example FROM user_profile ORDER BY id ASC LIMIT 2;
- SELECT device_id AS user_infos_example使用 AS 将查询结果中的列名从 device_id 改为 user_infos_example。
- FROM user_profile指定从用户信息表 user_profile 中查询。
- ORDER BY id ASC按照 id 升序排列,确保取到前两个用户。
- LIMIT 2限制结果为前两条记录。
查看7道真题和解析
