Ekklipce
Новичок
SUM() и COUNT() : "как же так" :=)
2 частных запроса с SUM и COUNT :
SELECT MONTHNAME( general.date_issue ) AS legend,
SUM( general.trademark ) AS coun
FROM general
WHERE general.magazine = '156' AND general.date_issue BETWEEN '2004-01-01' AND '2004-04-01'
GROUP BY legend
ORDER BY general.date_issue ASC
SELECT MONTHNAME( general.date_issue ) AS legend,
COUNT( general.trademark ) AS coun
FROM general
WHERE general.magazine = '156' AND general.date_issue BETWEEN '2004-01-01' AND '2004-04-01'
GROUP BY legend
ORDER BY general.date_issue ASC
Почему конструкция COUNT считает, а SUM выдаёт 0 ?
2 частных запроса с SUM и COUNT :
SELECT MONTHNAME( general.date_issue ) AS legend,
SUM( general.trademark ) AS coun
FROM general
WHERE general.magazine = '156' AND general.date_issue BETWEEN '2004-01-01' AND '2004-04-01'
GROUP BY legend
ORDER BY general.date_issue ASC
SELECT MONTHNAME( general.date_issue ) AS legend,
COUNT( general.trademark ) AS coun
FROM general
WHERE general.magazine = '156' AND general.date_issue BETWEEN '2004-01-01' AND '2004-04-01'
GROUP BY legend
ORDER BY general.date_issue ASC
Почему конструкция COUNT считает, а SUM выдаёт 0 ?