DB2 to MySQL query converter
am 27.03.2006 16:52:37 von jimnl69Does such a thing exist? I have the following DB2 query I need to
rewrite to work with MySQL and am having trouble:
SELECT DAY(`DATE`), CASE WHEN STATUS='O' OR STATUS='N' OR STATUS='V' OR
STATUS='H' OR STATUS='P' OR STATUS='C' OR STATUS='M' THEN 'O' ELSE 'I'
END AS STATUS, `GROUP`, COUNT (*) FROM DPS.MYTABLE WHERE
YEAR(`DATE`)=2006 AND MONTH(`DATE`)=3 GROUP BY `DATE`, `GROUP`, STATUS
ORDER BY 1, `GROUP`
If I remove COUNT(*) from the query it works but I don't get the count
that I need. Any help greatly appreciated!