[sql] Need a row count after SELECT statement: what's the optimal SQL approach?

If you are really concerned that your row count will change between the select count and the select statement, why not select your rows into a temp table first? That way, you know you will be in sync.