在工作中看到开大的写的SQL如下:
SELECT * FROM `test`.`tbl_live_user_campaign_status` WHERE campaign_id = 1 AND live_uid = XXXX ORDER BY `test`.`tbl_live_user_campaign_status`.`id` LIMIT 1;
我觉得可以省略为:
SELECT * FROM `test`.`tbl_live_user_campaign_status` WHERE campaign_id = 1 AND live_uid = XXXX limit 1;
比较好奇为啥开发要这么写?
哪条的执行效率高呢