What is wrong with this MySQL?
I'm a newbie at MySQL, so I'm sorry if this is too basic...

I want to merge this queries into only one, to return 2 values ("scount_atp" where estado=1 and "scount_xxx" where estado=4) by date:

    SELECT DATE_FORMAT(FROM_UNIXTIME(fecha),"%m-%d-%Y") as sdate, COUNT(id) as scount_atp FROM entradas WHERE estado = '1' AND fecha <= UNIX_TIMESTAMP(NOW()) AND fecha >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 YEAR)) GROUP BY sdate

    SELECT DATE_FORMAT(FROM_UNIXTIME(fecha),"%m-%d-%Y") as sdate, COUNT(id) as scount_xxx FROM entradas WHERE estado = '4' AND fecha <= UNIX_TIMESTAMP(NOW()) AND fecha >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 YEAR)) GROUP BY sdate

How can I do this?

Thanks!


What is wrong with this MySQL?
===

I'm a newbie at MySQL, so I'm sorry if this is too basic...

I want to merge this queries into only one, to return 2 values ("scount_atp" where estado=1 and "scount_xxx" where estado=4) by date:

    SELECT DATE_FORMAT(FROM_UNIXTIME(fecha),"%m-%d-%Y") as sdate, COUNT(id) as scount_atp FROM entradas WHERE estado = '1' AND fecha <= UNIX_TIMESTAMP(NOW()) AND fecha >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 YEAR)) GROUP BY sdate

    SELECT DATE_FORMAT(FROM_UNIXTIME(fecha),"%m-%d-%Y") as sdate, COUNT(id) as scount_xxx FROM entradas WHERE estado = '4' AND fecha <= UNIX_TIMESTAMP(NOW()) AND fecha >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 YEAR)) GROUP BY sdate

How can I do this?

Thanks!

