SELECT`s1`.`title`,`s1`.`description`,`s1`.`contacts`
FROM `spec` AS `s1`
LEFT JOIN (
SELECT `contacts`, COUNT(`contacts`) AS `count`
FROM `spec`
GROUP BY `contacts`) AS `s2` USING (`contacts`)
WHERE STATUS='' ORDER BY id DESC;
SELECT`s1`.`title`,`s1`.`description`,`s1`.`contacts`
FROM `spec` AS `s1`
LEFT JOIN (
SELECT concat(`contacts`,'.', 'title') as contacttitle, COUNT(`contacts`) AS `count`
FROM `spec`
GROUP BY 1) AS `s2` USING (`contacts`)
WHERE STATUS='' ORDER BY id DESC;
SELECT`s1`.`title`,`s1`.`description`,`s1`.`contacts`, `count`, contacttitle
FROM `spec` AS `s1`
LEFT JOIN (
SELECT `contacts`, COUNT(`contacts`) AS `count`, CONCAT(`title`, '--', `description`) AS contacttitle
FROM `spec`
GROUP BY 1) AS `s2` USING (`contacts`)
WHERE `status`='' AND id>19000
ORDER BY id DESC;