Problem:
The values in a column "Location" of your table are as follows:
Location
---------------
asw-qwer-sdf
bnm-sdr
cbn-hyt-opu
Write a query to retun the values as :
Location
-------------
aswQwerSdf
bnmSdr
cbnHytOpu
Solution:
select
location,
substr(location,1,instr(location,'-',1,1)-1)^^replace(initcap(substr(location,instr(location,'-',1,1)+1)),'-','')
from
sales
* replace ^^ by pipes...due to some printing issues pipes are not being displayed...
sqlite3
-
I just tried sqlite. It is ultra-light and support SQL commands. Just try
this $ sqlite3 test.db SQLite version 3.26.0 2018-12-01 12:34:55 Enter
".help" fo...
3 weeks ago
1 comment:
This is almost similar to ur query
select replace(substr(location,1,instr(location,'-')-1)||initcap(substr(location,instr(location,'-'))),'-','') Done from conversion
Cheers
Kartik
Post a Comment