求sql语句,只保留一列中的部分值?
比如:fsdf你好fdsfsfsdfospd呵呵fdfdfkjlkjldksd再见fdsfdsfds通过sql语句将这一列更新成:你好呵呵再见希望达人帮助.感谢你....
比如:fsdf你好fdsfsfsdf
ospd呵呵fdfdfkjlkjl
dksd再见fdsfdsfds
通过sql语句将这一列更新成:你好
呵呵
再见
希望达人帮助.感谢你. 展开
ospd呵呵fdfdfkjlkjl
dksd再见fdsfdsfds
通过sql语句将这一列更新成:你好
呵呵
再见
希望达人帮助.感谢你. 展开
2个回答
展开全部
以下是根据你的问题做的测试,希望对你有用:
CREATE TABLE kongxianji537 (a VARCHAR2(50));
-- 往表中插数据
INSERT INTO kongxianji537(a)VALUES('fsdf你好fdsfsfsdf');
INSERT INTO kongxianji537(a)VALUES('ospd呵呵fdfdfkjlkjl');
INSERT INTO kongxianji537(a)VALUES('dksd再见fdsfdsfds');
COMMIT;
-- 根据你的问题进行修改:
UPDATE kongxianji537 SET a= substr(a,5,2);
COMMIT;
CREATE TABLE kongxianji537 (a VARCHAR2(50));
-- 往表中插数据
INSERT INTO kongxianji537(a)VALUES('fsdf你好fdsfsfsdf');
INSERT INTO kongxianji537(a)VALUES('ospd呵呵fdfdfkjlkjl');
INSERT INTO kongxianji537(a)VALUES('dksd再见fdsfdsfds');
COMMIT;
-- 根据你的问题进行修改:
UPDATE kongxianji537 SET a= substr(a,5,2);
COMMIT;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询