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__)
|
||||
|
||||
def _select():
|
||||
my_max = sqlalchemy.sql.functions.max(vanth.tables.OFXUpdate.c.created)
|
||||
subselect = sqlalchemy.select([
|
||||
vanth.tables.OFXUpdate.c.ofxaccount,
|
||||
sqlalchemy.sql.functions.max(vanth.tables.OFXUpdate.c.created),
|
||||
]).group_by(
|
||||
my_max,
|
||||
]).limit(1).group_by(
|
||||
vanth.tables.OFXUpdate.c.ofxaccount
|
||||
).alias('ofxupdates')
|
||||
return sqlalchemy.select([
|
||||
|
|
Loading…
Reference in New Issue