Fix sql to return fewer results in subquery
Yay for the limit 1. I also fixed a bug I accidentally introduced when cleaning up my debug statements
This commit is contained in:
parent
500787fbd6
commit
6e448640b7
|
@ -11,10 +11,11 @@ import vanth.tables
|
||||||
LOGGER = logging.getLogger(__name__)
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
def _select():
|
def _select():
|
||||||
|
my_max = sqlalchemy.sql.functions.max(vanth.tables.OFXUpdate.c.created)
|
||||||
subselect = sqlalchemy.select([
|
subselect = sqlalchemy.select([
|
||||||
vanth.tables.OFXUpdate.c.ofxaccount,
|
vanth.tables.OFXUpdate.c.ofxaccount,
|
||||||
sqlalchemy.sql.functions.max(vanth.tables.OFXUpdate.c.created),
|
my_max,
|
||||||
]).group_by(
|
]).limit(1).group_by(
|
||||||
vanth.tables.OFXUpdate.c.ofxaccount
|
vanth.tables.OFXUpdate.c.ofxaccount
|
||||||
).alias('ofxupdates')
|
).alias('ofxupdates')
|
||||||
return sqlalchemy.select([
|
return sqlalchemy.select([
|
||||||
|
|
Loading…
Reference in New Issue