Andrew,
There's 2 options both requiring the addition of a new column (as float) to
your table that is then updated.
Version 1 is to update the new column with the rowid number thus:
Update Mytable Set Mycol = rowid
and then
Select * from Mytable where Mycol mod N into ran
Hi,
This will select every 100th record:
Select * From MYTABLE
Where ROWID Mod 100 = 0
This will select every 1000th record:
Select * From MYTABLE
Where ROWID Mod 1000 = 0
You can also change the 0 to any value between 0 and 100 or 1000.
Peter Horsbøll Møller
GIS Developer, MTM
Geographical I
Hi Andrew
You've probably had a number of replies already but here goes
To select every "n"th record from a table using SQL, type
rowid mod(n)=0
... into the "Where Condition" area of the dialog.
Hope this makes sense and is of some assistance.
Regards
Tony Maber - Certified Map
Andrew
lnRandNum = round( rnd(1) * 79000, 1) will give you a random no. 1 -
79000
Fetch record lnRandNum will get that record for you .
I don't know about "every 100 or every 1000 records" because I don't
know what that means. Do you mean "every 100th ... (after a random
record number) ..." or
Someone who knows more than I about SQL might have a way of specifying *
from one table only. Absent that, I have a workaround for you.
I'm assuming that you're using two tables because of the need to use one of
them to help select records -- e.g. selecting records where the FIPS code in
Table1 m
Hi Richard
Easy. I am new as well to MapInfo, but I am getting there. This is what you do: click
Query>SQL Select, then on the dialog box
Select Colums: *
>From Tables: Table Name you want to select from
Where Condition: Company Name like "Richard%"
Group by olumns:
Order by Columns:
into t
Try this:
Select * From MYTABLE Where MYCOLUMN Like "%Richard%"
or
Select * From MYTABLE Where InStr(1, MYCOLUMN, "Richard") > 0
Replace:
MYTABLE with the name of your table
MYCOLUMN with the name of the "Company Name" column
I'm not which is fastest, but they should do the same thing. Note that
Wade,
Maybe you should take a look at http://www.w3schools.com/sql/. It is not
MapInfo specific, but it should help you with SQL grammar a little bit. Hope
this helps.
Happy Hollidays everyone!!
Milton Fonseca
Research Analyst I
Mineral Resources and
Mineral Hazards Mapping Program
California