[ic] Query for count on column

Mark Johnson mark at endpoint.com
Thu Aug 17 07:51:58 EDT 2006


Tim Good wrote:
> Can someone please tell why this code snip will not work:
[snip]
> I have also tried:
> 
> [query sql="select count(sku) from products where ended =
> 0"][/query]

and

> Still have not discovered why query tag will not work, by its self in my
> original
> Post. If any one has ideas there I would really appreciate it.
> It would allow me to understand how understand interchange runs different
> queries.

Assuming the query is valid (which I can't verify), the use of [query]
is sending the results off into oblivion.

I am guessing from the context that you would expect the interpolation
to be replaced with the number showing count(sku). To do that, you need
(a) the list parameter true, and (b) the body to include the proper
PREFIX-* tags to show what you want:

> [query
> 	list=1
> 	sql="
> SELECT COUNT(sku)
> FROM products
> WHERE ended = 0
> "][sql-code][/query]

Mark

--
Mark Johnson
End Point Corporation
http://www.endpoint.com


More information about the interchange-users mailing list