[storm] Query using count

akira nhytro-python at web.de
Wed Aug 8 19:51:01 BST 2007


Hi Gustavo!

That got rid of the the traceback, now on to another problem, trying to 
use the example in the tutorial:

columns = (parent.link, Count()-1)
where = And(node.lft > parent.lft, node.lft < parent.rgt)
expr = Select(columns, where, order_by=node.lft)

test = SQL(("%s") % expr)

this gives me this:

<storm.expr.SQL object at 0x009F0230>

Which is not a result set, does this have to be executed?

Thanks!


Gustavo Niemeyer wrote:
> Hi,
>
>   
>> with which Python version did you run this with? I get  a syntax error
>> traceback using python 2.4, Pydev and Eclipse
>>
>> columns = (parent.link, Count(*)-1)
>>     
>
> Sorry, please remove the '*'.  I didn't try it, since I don't have the
> schema to test it.
>
>   




More information about the storm mailing list