On Mar 14, 2007, at 12:49 PM, Glauco wrote:

> This is perfect but when i try to use count function  the SQL  
> composer try to do an expensive sql.
>
>
> In [63]: print select([tbl['azienda'].c.id],  tbl['azienda']).count()
> SELECT count(id) AS tbl_row_count
> FROM (SELECT azienda.id AS id
> FROM azienda)
>

what makes you think that query is expensive ?  anyway, more succinct  
to just say table.count().

>
> Another question:
>
> Does anyone know how to use this object ?
>
> select([tbl['azienda'].c.id],  tbl['azienda']).count()
> <sqlalchemy.sql.Select object at 0xb6c803ac>
>

select(...).count().execute()

or

engine.connect().execute(select(...).count())





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to