Hi,
I have a very basic doubt in using sqlalchemy. My query is as follows.
My requirement is to test the inclusion or exclusion of a list of
values for a particular field.
result = session.execute(
select([
table1.c.address,
func.count(table1.c.address).label('count')
]
).where(and_(table1.c.type=='from',
table1.c.table2_id == table2.c.id,
table2.c.domain==unicode('naukri.com'),
table2.c.date.between(sdate,edate) )
).group_by(table1.c.address).order_by(func.count(table1.c.address).desc()))
For example in the following code I have
table2.c.domain==unicode('naukri.com'). Now there can be multiple
domains and it is dynamic.
How can I do something like:
table2.c.domain in ['naukri.com', 'gmail.com', 'yahoo.com']
Also how can I do something like
table2.c.domain not in ['naukri.com', 'gmail.com', 'yahoo.com']
Thanks and Regards,
Roopesh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~--~~~~--~~--~--~---