It all depends...
Basement- saw it off and couple new pipe on.
Slab- much harder. If the pipe is glued *inside* the flange there is a special tool to cut the pipe. Then you need a new flange with an extended collar.
If it's buried in cement, no picnic.
Jim