Let’s say we have a table for items that looks like this
item_id
item_visits
What should we add to this table, to be able to sort these items based on how many visits they have had in the last 7 days.
And how do we query that to the db?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sorry, I misunderstood the ask…
Well, of course you need to add a column named VisitTime which has type datetime.
After that I would suggest to create a set of views to help you making the query. For example a view named DailyVisit which has the amount of view in day(indicated by a date) for every item.