I am sure this is possible using SQL!
Hi I am writing an ASP.NET application that uses an Access2k database back end. I have 2 tables which I need to query to get a list of thumbnails representing all ablums in my system.
I have tblAlbum and tblPicture (tblPicture has FK to tblAlbum.AID), I want a query to return all album records, easy, but I want each record to have a reference(PID) to the latest image added to tblPicture for that album.
I am sure there must be a way of doing this, I have tried sub-queries various joins etc and the only solution I have found is to programatically add a PID reference to the Album record. This however requires a lot of checking to be done in the code when it comes to deleting pictures etc.
Any ideas?
|