Şehir/Ünvan İş İlanları
Şehir/Ünvan İş İlanları
Table 'rehabilitasyon.GENERAL' doesn't exist
SELECT *
FROM (
SELECT g.name_ AS city, a.title
, COUNT(IF(a.bitisTarihi >= CURDATE() AND a.deleted = 0, a.id, NULL)) AS sayi
FROM ads a, members m, GENERAL g
WHERE m.id = a.member_id
AND g.id = m.city
AND a.bitisTarihi > DATE_ADD(CURDATE(), INTERVAL -3 YEAR)
AND a.approved =1
AND a.activeByUser = 1
GROUP BY m.city, a.title
) AS d
ORDER BY sayi > 0 DESC, city, title