I'm not familiar enough with SQL syntax, and I need to make a little complicated SELECT.
I have a table with 3 fields: contentID, date and readsCounter.
I have to get the top 2 read contents for the last 2 days.
the lines above are 6 records from my db, contents 0 and 2 are the contents that need to be selected(the contents and the reads sum for the last 2 days).
I'm working with MSACCESS DB. someone can help me?
SELECT TOP 2
, SUM(readsCounter) AS total
WHERE date IN
( SELECT TOP 2
FROM ( SELECT date AS distinct_date
BY date ) AS d
BY distinct_date DESC )
BY total DESC