(no subject)
Sep. 7th, 2011 03:35 pmОцените:
SELECT f.file FROM product_foto as f, product as p, product_foto_rel as r WHERE r.product_id = p.id and r.foto_id = f.id AND CONCAT(LOWER(p.name), '_', p.catalog_id, '_', p.manuf_id) = '����������� ������� mission rs 7 \'11_1111_37144' ORDER BY f.file;
SELECT cc.nick as cc_nick, cc.name as cc_name, c.nick as c_nick, c.name as c_name, sc.nick as sc_nick, sc.name as sc_name, count(DISTINCT CONCAT(LOWER(p.name), '_', p.catalog_id, '_', p.manuf_id)) as num FROM product as p, catalog as c, catalog as cc, catalog1c as sc WHERE p.manuf_id = '1221' AND ((p.catalog_id = sc.id_1c) OR (SELECT count(*) FROM product_catalog_rel as rr WHERE rr.product_id = p.id AND rr.catalog_id = sc.id_1c)) AND sc.visible = 1 AND sc.catalog_id = c.id AND c.visible = 1 AND cc.visible=1 AND cc.id=c.parent_id GROUP BY sc.id ORDER BY cc.srt, c.srt, sc.srt;
SELECT f.file FROM product_foto as f, product as p, product_foto_rel as r WHERE r.product_id = p.id and r.foto_id = f.id AND CONCAT(LOWER(p.name), '_', p.catalog_id, '_', p.manuf_id) = '����������� ������� mission rs 7 \'11_1111_37144' ORDER BY f.file;
SELECT cc.nick as cc_nick, cc.name as cc_name, c.nick as c_nick, c.name as c_name, sc.nick as sc_nick, sc.name as sc_name, count(DISTINCT CONCAT(LOWER(p.name), '_', p.catalog_id, '_', p.manuf_id)) as num FROM product as p, catalog as c, catalog as cc, catalog1c as sc WHERE p.manuf_id = '1221' AND ((p.catalog_id = sc.id_1c) OR (SELECT count(*) FROM product_catalog_rel as rr WHERE rr.product_id = p.id AND rr.catalog_id = sc.id_1c)) AND sc.visible = 1 AND sc.catalog_id = c.id AND c.visible = 1 AND cc.visible=1 AND cc.id=c.parent_id GROUP BY sc.id ORDER BY cc.srt, c.srt, sc.srt;