leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0601.sql (310B)


      1 SELECT DISTINCT S1.*
      2 FROM Stadium AS S1, Stadium AS S2, Stadium AS S3
      3 WHERE S1.people >= 100 AND S2.people >= 100 AND S3.people >= 100
      4     AND ((S1.id + 1 = S2.id AND S1.id + 2 = S3.id)
      5       OR (S1.id - 1 = S2.id AND S1.id - 2 = S3.id)
      6       OR (S1.id - 1 = S2.id AND S1.id + 1 = S3.id))
      7 ORDER BY visit_date
      8