Using data from one sub query within another
Currently I have a query that is getting a list of forum topics from a topics table. I also have a views table which stores when a registered user has viewed each topic.
What I want to do is select the last viewed time from the views table then count how many posts have a time less than that.
Is it possible to do this in 1 query?
This is my attempt but I'm not sure if this is possible. If it is then my Google skills are lacking.
Any help would be much appreciated.