SELECT * FROM dbo.Artists a INNER JOIN Artworks aw ON a.aId = aw.aId LEFT JOIN Images i ON aw.awId = i.artwork AND i.iStatus = 1 WHERE aURL LIKE ? AND aStatus >= iif(0 = 1,0,1) AND awStatus >= iif(0 = 1,0,1) ORDER BY awOrder ASC, aw.aId ASC
John-Horswell