Database: art_1
Question: What are the distinct ids of every painting that is older than some painting in gallery 240?
SQL:
SELECT paintingID FROM paintings WHERE YEAR  <  (SELECT max(YEAR) FROM paintings WHERE LOCATION  =  "Gallery 240")