SELECT id, home, template, s.params
FROM pcpr1_template_styles as s
LEFT JOIN pcpr1_extensions as e ON e.element=s.template AND e.type='template' AND e.client_id=s.client_id
WHERE s.client_id = 0 AND e.enabled = 1

SELECT cc.*, a.filename, a.extm, a.exts, a.extw, a.exth FROM pcpr1_phocagallery_categories AS cc LEFT JOIN pcpr1_phocagallery AS a ON cc.id = a.catid WHERE cc.parent_id = 7 AND cc.published = 1 AND cc.approved = 1 AND cc.id <> 7 GROUP BY cc.id ORDER BY cc.ordering ASC

SELECT a.*, cc.alias AS catalias, cc.accessuserid AS cataccessuserid, cc.access AS cataccess, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(':', cc.id, cc.alias) ELSE cc.id END as catslug FROM pcpr1_phocagallery AS a LEFT JOIN pcpr1_phocagallery_img_votes_statistics AS r ON r.imgid = a.id LEFT JOIN pcpr1_phocagallery_categories AS cc ON cc.id = a.catid WHERE a.catid= 7 AND a.published = 1 AND a.approved = 1 ORDER BY a.ordering ASC LIMIT 0, 20

SELECT a.*, cc.alias AS catalias, cc.accessuserid AS cataccessuserid, cc.access AS cataccess, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(':', cc.id, cc.alias) ELSE cc.id END as catslug FROM pcpr1_phocagallery AS a LEFT JOIN pcpr1_phocagallery_img_votes_statistics AS r ON r.imgid = a.id LEFT JOIN pcpr1_phocagallery_categories AS cc ON cc.id = a.catid WHERE a.catid= 7 AND a.published = 1 AND a.approved = 1 ORDER BY a.ordering ASC

SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up, a.publish_down, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LENGTH(a.fulltext) AS readmore ,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,contact.id as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published
FROM pcpr1_content AS a
LEFT JOIN pcpr1_content_frontpage AS fp ON fp.content_id = a.id
LEFT JOIN pcpr1_categories AS c ON c.id = a.catid
LEFT JOIN pcpr1_users AS ua ON ua.id = a.created_by
LEFT JOIN pcpr1_users AS uam ON uam.id = a.modified_by
LEFT JOIN pcpr1_contact_details AS contact on contact.user_id = a.created_by
LEFT JOIN pcpr1_categories as parent ON parent.id = c.parent_id
LEFT JOIN pcpr1_content_rating AS v ON a.id = v.content_id
LEFT OUTER JOIN (SELECT cat.id as id FROM pcpr1_categories AS cat JOIN pcpr1_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id
WHERE a.access IN (1,1) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND a.catid IN (7) AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2018-12-19 10:17:22') AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2018-12-19 10:17:22')
ORDER BY a.hits DESC LIMIT 0, 3

SELECT c.*,CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug
FROM pcpr1_categories as c
LEFT JOIN pcpr1_categories AS s ON (s.lft <= c.lft AND s.rgt >= c.rgt) OR (s.lft > c.lft AND s.rgt < c.rgt)
LEFT JOIN (SELECT cat.id as id FROM pcpr1_categories AS cat JOIN pcpr1_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id) AS badcats ON badcats.id = c.id
WHERE (c.extension='com_content' OR c.extension='system') AND c.access IN (1,1) AND c.published = 1 AND s.id=7 AND badcats.id is null
GROUP BY c.id
ORDER BY c.lft

SELECT a.*, c.published AS c_published,
CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,
CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug,
DATE_FORMAT(a.date, "%Y-%m-%d") AS created,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author
FROM `pcpr1_weblinks` AS a
LEFT JOIN pcpr1_categories AS c ON c.id = a.catid
LEFT JOIN pcpr1_users AS ua ON ua.id = a.created_by
LEFT JOIN pcpr1_users AS uam ON uam.id = a.modified_by
WHERE a.access IN (1,1) AND a.catid = 6 AND c.access IN (1,1) AND c.published = 1 AND a.state = 1
ORDER BY title asc

SELECT a.*, c.published AS c_published,
CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,
CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug,
DATE_FORMAT(a.date, "%Y-%m-%d") AS created,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author
FROM `pcpr1_weblinks` AS a
LEFT JOIN pcpr1_categories AS c ON c.id = a.catid
LEFT JOIN pcpr1_users AS ua ON ua.id = a.created_by
LEFT JOIN pcpr1_users AS uam ON uam.id = a.modified_by
WHERE a.access IN (1,1) AND a.catid = 6 AND c.access IN (1,1) AND c.published = 1 AND a.state = 1
ORDER BY title asc LIMIT 0, 5

23 типов SQL-запросов зафиксировано, отсортировано по вхождениям

Запросы типа SELECT:

2 × SELECT a.*, cc.alias AS catalias, cc.accessuserid AS cataccessuserid, cc.access AS cataccess, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(':', cc.id, cc.alias) ELSE cc.id END as catslug FROM pcpr1_phocagallery AS a LEFT JOIN pcpr1_phocagallery_img_votes_statistics AS r ON r.imgid = a.id LEFT JOIN pcpr1_phocagallery_categories AS cc ON cc.id = a.catid

2 × SELECT a.*, c.published AS c_published, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug, DATE_FORMAT(a.date, "%Y-%m-%d") AS created,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author FROM `pcpr1_weblinks` AS a LEFT JOIN pcpr1_categories AS c ON c.id = a.catid LEFT JOIN pcpr1_users AS ua ON ua.id = a.created_by LEFT JOIN pcpr1_users AS uam ON uam.id = a.modified_by

1 × SELECT c.*,CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug FROM pcpr1_categories as c LEFT JOIN pcpr1_categories AS s ON (s.lft <= c.lft AND s.rgt >= c.rgt) OR (s.lft > c.lft AND s.rgt < c.rgt) LEFT JOIN (SELECT cat.id as id FROM pcpr1_categories AS cat JOIN pcpr1_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt

1 × SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up, a.publish_down, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LENGTH(a.fulltext) AS readmore ,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,contact.id as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published FROM pcpr1_content AS a LEFT JOIN pcpr1_content_frontpage AS fp ON fp.content_id = a.id LEFT JOIN pcpr1_categories AS c ON c.id = a.catid LEFT JOIN pcpr1_users AS ua ON ua.id = a.created_by LEFT JOIN pcpr1_users AS uam ON uam.id = a.modified_by LEFT JOIN pcpr1_contact_details AS contact on contact.user_id = a.created_by LEFT JOIN pcpr1_categories as parent ON parent.id = c.parent_id LEFT JOIN pcpr1_content_rating AS v ON a.id = v.content_id LEFT OUTER JOIN (SELECT cat.id as id FROM pcpr1_categories AS cat JOIN pcpr1_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt

1 × SELECT c.*, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as slug FROM pcpr1_phocagallery_categories AS c