I have an images table which stores an image id, title, the user who uploads it, a timestamp and file extension.
I also have a views table which records when an image has been viewed. the columns are id, image id, timestamp and the user who viewed the image.
What i need and have no idea how to do is to run an SQL query which will return a set of images in order of the most viewed.
I've been looking around on here and Google but just don't know what to actually search.