How would I go about creating a most popular sql query where it looks in the transaction table, looks at the item id and sees how many times it appears within 30 days using the date and then order all the items by most popular LMIT 20?
Another SQL question is how do i get all data if someone views a parent category and then it basically gets the data from all other ctaegories that have X listed as the parent_id? Thanks so for example if they go to category/3/ it gets all item data associated with that category but is it possible to make it so that you go to category/1 and then it finds and gets all the data that shows for other categories so in this case all the categories with parent_id 1?
Thanks in advance.