Why use the BETWEEN operator when we can do without it?

前端 未结 11 842
孤独总比滥情好
孤独总比滥情好 2020-12-09 17:31

As seen below the two queries, we find that they both work well. Then I am confused why should we ever use BETWEEN because I have found that BETWEEN behaves differently in d

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 17:59

    worse if it's

      SELECT id FROM entries 
      WHERE 
         (SELECT COUNT(id) FROM anothertable WHERE something LEFT JOIN something ON...) 
         BETWEEN entries.max AND entries.min;
    

    Rewrite this one with your syntax without using temporary storage.

提交回复
热议问题