i'm try to get data last by 30 days, and then i'm order this by hit because i want to get last 30 days data trending.
SELECT *,
category.title AS nama_kategori
FROM category
join posting
ON category.alias = posting.id_category
WHERE DATE BETWEEN Now() - interval 30 day AND Now()
AND id_category LIKE '%gga%'
OR id_category LIKE '%wstb%'
ORDER BY posting.hit DESC
the output of this query is there the data is not las by 30 days ( since 1 oct ) there the other data that have other years. enter image description here