SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY ltrim(rtrim(products.artist))) AS n, products.artist, MAX(products.permalink) AS permalink, MAX(image) AS artistImage FROM products WHERE products.inactive<>1 AND (products.artist LIKE '0%' OR products.artist LIKE '1%' OR products.artist LIKE '2%' OR products.artist LIKE '3%' OR products.artist LIKE '4%' OR products.artist LIKE '5%' OR products.artist LIKE '6%' OR products.artist LIKE '7%' OR products.artist LIKE '8%' OR products.artist LIKE '9%') and permalink<>'' and permalink is not null GROUP BY products.artist) AS a WHERE a.n BETWEEN (20) AND (40)
Go to page: «