Here is my query:
Select Top 10 CS.CaseStudyID,
CS.Title,
CSI.ImageFileName
From CaseStudy CS
Left Join CaseStudyImage CSI On CS.CaseStudyID = CSI.CaseStudyID
And CSI.CSImageID in(
Select Min(CSImageID) -- >not really satisfactory
From CaseStudyImage
Group By CaseStudyID
)
Order By CS.CaseStudyID ASC
Instead of min(CSImageID) I'd like a random record from my CaseStudyImage table that corresponds to the particular case study
Can anyone point me in the right direction pleas?