3 ms·
Sorry but I am voting for the opposite solution, meaning: with Session( engine ) as session: youngest_ids_subq = ( select( func.max( Pe
by AmbroseBierce 1y ago
Sorry but I am voting for the opposite solution, meaning:
with Session( engine ) as session:
youngest_ids_subq = (
select( func.max( People.id ).label( "max_id" ) )
.group_by( People.name )
.subquery()
)
purge_stmt = (
delete( People )
.where( People.id.not_in( select( youngest_ids_subq.c.max_id ) ) )
)
session.execute( purge_stmt )
session.commit()
unique_idx = Index( "uq_people_name", People.name, unique=True )
unique_idx.create(bind=engine)
- sebastiennight 11mo agoSo as the younger iteration, our friend Mark would now own bankrupcy offices now, on top of his shares in Meta, and be protected from impersonation forever. Your version of the Purge would make an interesting Stephen King movie.
- AmbroseBierce 11mo agoOh I wasn't talking about that part of the equation, in the money regards I think in the people_money table we would be better off running "truncate"