[ic] Query for count on column
Tim Good
tim.g at edsd.com
Thu Jul 27 11:42:29 EDT 2006
Can someone please tell why this code snip will not work:
[perl tables="products"]
my $db = ::database_exists_ref('products') or die 'bad
products table';
my $sql = '';
$sql="select count(sku) from products where ended = 0";
my $results = $db->query({sql => $sql, wantarray => 1 });
return $results->[0]->[0];
[/perl]
I have also tried:
[query sql="select count(sku) from products where ended =
0"][/query]
Thanks,
tim
More information about the interchange-users
mailing list