Hacker News new | ask | show | jobs
by AmbroseBierce 221 days 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)
1 comments

So 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.

Oh 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"