I can't to build this query it returns all rows from table. I want to select only this records where catid is between 1 and 20 and only these records from interval of 30days. Seperated both queries working.
- SELECT * FROM `movies` WHERE uploaded >= DATE_SUB(NOW()
- SELECT id FROM `movies` WHERE (catid BETWEEN 1 AND 20)
Whole query with subquery:
SELECT * FROM `movies` WHERE uploaded >= DATE_SUB(NOW(), INTERVAL 30 DAY) IN(SELECT id FROM `movies` WHERE (catid BETWEEN 1 AND 20))