i got problem in making a correct query statement. how could get helpf from the forum.
city name
city1 a
city1 b
city1 c
city1 d
city2 e
city2 f
SELECT count(*), city, name FROM $table_order WHERE (MONTH(orderdate) = MONTH(now())) group by city );
while (my $rec = $sth->fetchrow_arrayref())
{ print "$rec->[0] : $rec->[1] :$rec->[2]\n"; }
the result will be
4 : city1: a
1 : city2: e
how to make the query result be:
4 : city1: d
1 : city2: f
Thanks in advance.
city name
city1 a
city1 b
city1 c
city1 d
city2 e
city2 f
SELECT count(*), city, name FROM $table_order WHERE (MONTH(orderdate) = MONTH(now())) group by city );
while (my $rec = $sth->fetchrow_arrayref())
{ print "$rec->[0] : $rec->[1] :$rec->[2]\n"; }
the result will be
4 : city1: a
1 : city2: e
how to make the query result be:
4 : city1: d
1 : city2: f
Thanks in advance.