On Mar 12, 2014, at 10:36 AM, pyArchInit ArcheoImagineers <pyarchi...@gmail.com> wrote:
> Hi to all, > I looked for around the web without success. > I need to reproduce this kind of SQL distinct query: > SELECT DISTINCT column1 from table where column3= 'Value' > or two or more: > SELECT DISTINCT column1,column2 from table where column3= 'Value' > > I tried something like this without success: > > session.query(MAPPER_CLASS_TABLE).filter(MAPPER_CLASS_TABLE.column3=='Value').distinct(MAPPER_CLASS_TABLEI.column1) > But distinct doesn't accept more than one argument: type error: <lambda> () > takes exactly 1 argument (2 given) > > How I must set distinct properly? > > Thanks a lot for the help and best regards. that's a DISTINCT that applies to the whole statement (I see no parenthesis). just call distinct(), no arguments. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.