Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are multiple rows in my .tab file in mapinfo. Is there any way to select nth row in mapbasic window of mapinfo?

share|improve this question
up vote 4 down vote accepted

Select * from 'table' Where RowID = n

If you want it into a selection table of your choice, put the selection into somename, then browse * from somename If not, just Browse from selection


This is all from memory, so please play about and also read the online reference manual:

MapBasic Ref

MapInfo -L

share|improve this answer
By the way, the help is ok. – Hairy Aug 11 '11 at 7:41
+1 @Hairy very helpful and thanks – kinkajou Aug 11 '11 at 7:44
nps. Seriously though, have a look at the help, as they'll give code samples, you can play with. I'd also recommend 'MapInfo -l'. It's sort of a way of searching through some cracking code samples. – Hairy Aug 11 '11 at 7:50
yes I have the user guide I am studying but small things confuse me :( – kinkajou Aug 11 '11 at 7:57
well, nps, you'll get answers here as long as you accept them and act in good grace (which I fail to do sometimes). – Hairy Aug 11 '11 at 8:48

Very simple with Fetch:

Fetch rec 125 From Database

will find record #125 in your database...

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Fetch will only set the cursor at that position and not "select" the actual row. But it does depend on what he wants to do with the row afterwards – Peter Horsbøll Møller Aug 5 '15 at 19:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.