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

i have a database that has got tables with images and some of the tiles for the images is repeated and i want to eliminate the duplicates based on which imagery is oldest so as to remain with the newest images, i have run the following to get the duplicates from the database but do not know how to delete the row based on the age of the imagery

select "index",path from ngi_catalog_aug2012 where "index" in 
(SELECT "index"
 FROM ngi_catalog_aug2012
GROUP BY "index"
HAVING ( COUNT("index") > 1 )
) order by "index"

this gives results like

index       path

2228BD_23    /data/ngi_old/images_30k_sid/2228/2228BD_23_498_469_12_0007_PAN_RECT.sid

2228BD_23   /data/ngi_old/images_30k_sid/2228BD/2228BD_23_498_469_11_0100_PAN_RECT.sid

and i would like to delete for instance the second row

share|improve this question
Does your ngi_catalog_aug2012 table have a primary key? If not then you'll have to delete by the path: DELETE FROM ngi_catalog_aug2012 WHERE path='2228BD/2228BD_23_498_469_11_0100_PAN_RECT.sid'; – Micha Dec 20 '12 at 9:51

Your Answer


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

Browse other questions tagged or ask your own question.