我无法获取NULL值

时间:2013-11-08 02:13:29

标签: mysql sql isnull

我正在尝试获取总数为零的所有名称(在这种情况下为NULL)但我的查询没有响应。我知道至少有一个人的SUM等于零(或NULL),这是我的查询:

SELECT *
FROM   (SELECT m.name                                 AS nombre,
               DATE(MIN(m.created_at))                AS fecharegistro,
               SUM(p.amount)                          AS Total,
               u.email                                AS Mail,
               CONCAT(u.first_name, " ", u.last_name) AS Contacto
        FROM   payment p,
               merchant m,
               user u
        WHERE  p.merchant_id = m.uuid
               AND p.user_id = u.uuid
        GROUP  BY m.name) AS inner_table
WHERE  Total IS NULL  

0 个答案:

没有答案