Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i have a table with two columns: one named index and the other is called tilenumber and the tilenumber is populated from the index column except that there is _ which needs to be removed from the column.

The index table has values like 2726BA_11 and the tilenumber should result in 2726BA11 but i seem not to know the way forward, to remove the space i have done the following:

select distinct replace (tilenumber,'_', '') from aug2012

and it shows that the result has been achieved but how do i incorporate the select distinct replace in the update statement which is

update set tilenumber="index"
share|improve this question
add comment

1 Answer 1

I'm not sure this is really the place for basic SQL, but I guess it is loosely related to GIS....

This is pretty basic stuff, you really need to read about SQL if you're trying to do anything in GIS with it:

update yourtable set tilenumber = replace(index,'_','')

I would start with the basics of SQL itself (e.g http://sqlzoo.net/ and then move onto the sqlite3 documentation (http://www.sqlite.org/lang.html) as that's a bit more esoteric.

share|improve this answer
add comment

Your Answer

 
discard

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.