> From: Victoria Reznichenko [mailto:[EMAIL PROTECTED]
> What error message did you receive? Your query worked fine for me: When I say: SELECT IF(t2.status IN(2,3,4), "open", "closed") t2st, COUNT(t2st) FROM tasks t2 GROUP BY t2st; I get: #1054 - Unknown column 't2st' in 'field list' The count(*) and grouping by the field number were both new to me, and I'm up and working with them. Thanks, =Austin > mysql> create table tasks(status int); > Query OK, 0 rows affected (0.00 sec) > > mysql> insert into tasks values (1),(2),(3),(4),(5); > Query OK, 5 rows affected (0.00 sec) > Records: 5 Duplicates: 0 Warnings: 0 > > mysql> SELECT IF(t2.status IN(2,3,4), "open", "closed") t2st FROM > tasks t2 GROUP BY t2st; > +--------+ > | t2st | > +--------+ > | closed | > | open | > +--------+ > 2 rows in set (0.00 sec) > > mysql> SELECT IF(t2.status IN(2,3,4), "open", "closed") t2st, > count(*) FROM tasks t2 GROUP BY t2st; > +--------+----------+ > | t2st | count(*) | > +--------+----------+ > | closed | 2 | > | open | 3 | > +--------+----------+ > 2 rows in set (0.00 sec) > > > > -- > For technical support contracts, goto https://order.mysql.com/?ref=ensita > This email is sponsored by Ensita.net http://www.ensita.net/ > __ ___ ___ ____ __ > / |/ /_ __/ __/ __ \/ / Victoria Reznichenko > / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] > /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net > <___/ www.mysql.com > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
