Second SELECT query if first SELECT returns 0 rows

前端 未结 5 1435
萌比男神i
萌比男神i 2020-12-01 16:31

I am trying to speed up a PHP script and I am currently pushing some PHP logic in the Mysql domain of the thing. Is there a way to make a different select query if the first

5条回答
  •  攒了一身酷
    2020-12-01 16:53

    Another way:

    SELECT A INTO @v FROM proxies ORDER BY A LIMIT 1;
    SELECT * FROM proxies WHERE A=@v
    

提交回复
热议问题