Only updating part of a column
Only updating part of a column
От:
Dave Smith <dave@candata.com>
Дата:
I would like to know if I can update part of a column. ie update myfile set substr(direct_key,1,10)='1234567890' where substr(direct_key,1,10)='0987654321'; This does not work. Is this possible? Or am I looking at this the wrong way? -- Dave Smith Candata Systems Ltd. (416) 493-9020 dave@candata.com
Re: Only updating part of a column
От:
Thomas Lockhart <lockhart@alumni.caltech.edu>
Дата:
> I would like to know if I can update part of a column. ie
> update myfile set substr(direct_key,1,10)='1234567890' where
> substr(direct_key,1,10)='0987654321';
update myfile
set direct_key = '1234567890' || substring(direct_key from 11)
where substring(direct_key from 1 for 10) = '0987654321';
Note that you can use substr() also...
- Thomas