select `device_id` from `user_profile`
    limit 0,2;

分页查询的LIMIT子句,LIMIT start, row,其中start为开始的位置(第一行为0),row为想要查询几行记录。