jose wrote:

>John Lavoie wrote:
>
>  
>
>>Michael,
>>
>>Can you explain why this is the preferred method?  Wouldn't it just be 
>>simpler and cleaner to do the following?
>>
>>conn.execute("select max(numero) from bolletta where anno=:anno",anno=2006)
>> 
>>
>>    
>>
>This is a good question, Michael. I hope somebody can answer this question.
>
>I'm trying to write my queries using only the mappers but sometimes I 
>have difficult to do that.
>I have many queries in my programs written in pure sql but I feel 
>myself  "guilt" :-[ 
>and I'm trying to convert  all of them.
>SQLAlchemy allows you to do the same thing in too many ways. 
>At this point I would like to know, what is the best way (or the right 
>way to do things).
>
>jo
>
>
>  
>
sometimes i merged sql pure with mappers like this:

sql=select(["count(*)"], from_obj=[azienda])  -- because func.count(*) 
doesn't work

sql=select(["azienda.id as pk"], from_obj=[azienda]) --  alias...

I confess, I'm new to SA, thus I beleave these things can be done in a 
best way.... :-\
Sometimes, I have to do mortal jumps to write sample sql commands.

jo
 




>>John
>>
>>Michael Bayer wrote:
>> 
>>
>>    
>>
>>>select([func.max(tbl['bolletta'].c.numero)],
>>>tbl['bolletta'].c.anno==2006)
>>>
>>>
>>>   
>>>
>>> 
>>>   
>>>
>>>      
>>>
>> 
>>
>>    
>>
>
>
>>
>  
>


--~--~---------~--~----~------------~-------~--~----~
 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