Mam neco takoveho. Potreboval bych to napsat nejak elegantne do jednoho radku a treti sloupec by byl porovnani obou hodnot. Jedna se o pocet mailu, limit mailu a zda uzivatel tento limit prekrocil.
(SELECT COUNT(*) AS `count`,NULL FROM `contact`)
UNION ALL
(SELECT NULL,`pay_mail_limit` AS `limit` FROM `user_acount` WHERE '.$u.' LIMIT 1)