Hey Sandro,

My understanding is, the from_obj isn't necessary here.  Regardless, though,
it works fine with it (or without it) as the resulting query isn't
substantially changed.  Adding the missing comma from the sample code and
fixing the print statement so that it iterates through the 'R.mail' property
gives me the correct values for 1419.  What build are you using?
-G

On Tuesday, May 9, 2006, 9:48:04 PM, you wrote:
> Hi,

>   the attached script produces a sql statement that I can't correctly
>   interpret but anyhow gives wrong results (doubled rows):

>   m.select(users.c.user_id == mails.c.user_id, from_obj=[users])



>     SELECT user_tbl.user_last_name AS user_tbl_user_last_name,
>     mail_tbl_3b11.user_id AS mail_tbl_3b11_user_id, mail_tbl_3b11.mail_address
>     AS mail_tbl_3b11_mail_address, user_tbl.user_id AS user_tbl_user_id,
>     user_tbl.user_name AS user_tbl_user_name 
>     FROM mail_tbl, user_tbl LEFT OUTER JOIN mail_tbl AS mail_tbl_3b11 
>     ON user_tbl.user_id = mail_tbl_3b11.user_id
>     WHERE user_tbl.user_id = mail_tbl.user_id

>   All the examples in the documentation have a neater statement (FROM table1
>   LEFT JOIN table2).  

>   Adding another condition as in 
>   
>   m.select(and_(
>     users.c.user_id == mails.c.user_id ,
>     mails.c.mail_address.like('%a%')
>     )
>     from_obj=[users])

>   just fails (no LIKE whereclause applied)

>   Is this an SA bug or I'm doing something wrong with the select?


>   TIA
>   sandro


> PS: should I use from_obj? I never see a difference if I use the join
>     condition... 





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to