sql - Add single character to string without using update -
problem
i have around 5 hundred names in database end abbreviated name, e.g.:
┌────────────┬───────────┐ │ fname │ lname │ ├────────────┼───────────┤ │ berthe m │ bjaaland │ │ markus m │ nilsen │ │ ole t │ rasmussen │ └────────────┴───────────┘
i use find , replace add full stop after single-character names (no norwegian names consist of single characters, know abbreviations). easy if run update query, not have access that. there way find , replace or other workaround?
desired result
┌────────────┬───────────┐ │ fname │ lname │ ├────────────┼───────────┤ │ berthe m. │ bjaaland │ │ markus m. │ nilsen │ │ ole t. │ rasmussen │ └────────────┴───────────┘
further usage
once working, same method applied changing names single letter in middle, syntax ‘* ? *’.
───
notes
i running access 2007 towards oracle.
sql find names:
select kommnr, kretsnr, bostnr, persnr, fornvn, ettnvn folketellinger_kperson_1875 fornvn "* ?";
i found couldn’t use syntax run filter, returned ending in character, rather ending in space and character. surprised me, have found many of dummy characters can use in like
queries work in searches/filters too.
i assume sql need run update, this:
update folketellinger_kperson_1875 set folketellinger_kperson_1875.fornvn = "* ?." folketellinger_kperson_1875.fornvn "* ?";
i tried copying syntax single find , replace, field instead changed ‘* ?.’, not surprise.
───
p. s.: added sql-update tag, though not want use it; if should removed, please let me know in comments.
p. p. s.: drawing ascii table surprisingly calming; want work …
if don't want update data, write select query desired result.
iif()
distinguish cases:
select fornvn, [fornvn] & iif([fornvn] "* ?",".","") fornvn_dot etc.
Comments
Post a Comment