count distinct is not working

Issue #135 resolved
Former user created an issue

func.count( 'DISTINCT someCol' ) is returning the wrong value

func.count( items.c.someCol.distinct( ) ) is not working at all

Comments (1)

  1. Mike Bayer repo owner

    fixed in changeset:1223

    you can do:

       func.count(table.c.mycol.distinct()).select()
    

    or the workaround method you were trying would actually look like:

       func.count(text('DISTINCT mycol')).select()
    
  2. Log in to comment