I need to create a table to track page visits to landing pages on a website
based on the page name / the member ID / the Year / the Month and maintain the count of visits based on each unique combination
Basically, I think I can create a table with 6 fields rec_id | pg_name | mem_id | ct_year | ct_month | count
We have 30 landing pages currently and will be adding more, and need to provide members with how many of each of them has been hit using their individual link in various ways, like YTD / MTD / etc...
What I would like to know before I get started, is if there is a way to do a single query that would check to see if there is a record with the current pg_name/mem_id/ct_year/ct_month combination, and if there is, to simply increment the count by 1, but if there isn't one, then to do an insert of a record with a count of 1
If my logic if flawed, please let me know, and if you can do both in a single query, please let me know that as well
I can't give sample data or anything because I haven't even created the table yet. just want to find out if it is possible to do it before I get started.