Thanks. I had thought of tracking column names; unlike number of columns, column names are much more likely to be different but still not full proof. >select * from mytable where gender = 'M';select * from mytable where gender = 'F'; Mind you, that really ought to be this: >select * from myTable order by gender desc; Practically speaking, I think tracking column names will work in the absence of a better indicator.