| 1990 | ) |
| 1991 | |
| 1992 | def test_distinct_function(self): |
| 1993 | self.assert_compile( |
| 1994 | select(func.sum(distinct(table1.c.myid))), |
| 1995 | "SELECT sum(DISTINCT mytable.myid) AS sum_1 FROM mytable", |
| 1996 | ) |
| 1997 | |
| 1998 | self.assert_compile( |
| 1999 | select(func.count(table1.c.myid.distinct())), |
| 2000 | "SELECT count(DISTINCT mytable.myid) AS count_1 FROM mytable", |
| 2001 | ) |
| 2002 | |
| 2003 | self.assert_compile( |
| 2004 | select(func.count(distinct(table1.c.myid))), |
| 2005 | "SELECT count(DISTINCT mytable.myid) AS count_1 FROM mytable", |
| 2006 | ) |
| 2007 | |
| 2008 | def test_distinct_function_warn_outside_aggregate(self): |
| 2009 | with testing.expect_warnings( |