I'm using MapBasic and have used a query to get the rowids (populated in a column) of minimum values

Select SUBSECT_ID, Row, Min(MaxLV)from LVQuery group by SUBSECT_ID into MinLV

Now, I want to delete these entries from the main Table (LVQuery). However I cannot as MapInfo won't let me delete from a view. How do I circumvent this.


You need to select all the records from the main table which match the ID's in your query results (MinLV). You should then be able to delete those records.

Select * from LVQuery where RowID = Any(Select Row from MinLV) into ToDelete NoSelect
Delete from ToDelete

I think the reason you couldn't delete from MinLV is that it is aggregated data so it wouldn't be clear which records to delete.

  • Take really good care when comparing ROWID's between queries. I would recommend using a static ID column instead – Peter Horsbøll Møller Mar 28 '16 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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