1

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"

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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