用新值替换sql中的数值

时间:2017-07-15 05:47:26

标签: mysql

我有多个值,如下所示:

1.212302157,305027504,302002744
2.305027504,302002744,212302157

我想删除212302157并添加212605226。

同一行的单行更新查询是什么。

1 个答案:

答案 0 :(得分:0)

我认为这不是最好的方式.. 但我对这个问题的回答是

语法:

from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.app import App
from kivy.properties import StringProperty

kv_text = '''
#simplekivy.kv
<Page>:
    img: ''                    #<<<<<<<<<<<<<<<<<<
    canvas.before:
        Color:
            rgba:0,0,1,1
        Rectangle:
            pos: self.pos
            size: self.size 

    Image:          
        pos_hint:{"center_x":0.4,"y":0.3}
        color:255,1,1,1
        size:70,70
        source: root.img

    Label:      
        pos:0,0
        font_size:80
        text:root.id1

    Button:
        size_hint:0.5,0.2       
        font_size:60
        text:"Start"
        on_press:  app.onClick()
'''


class Page(BoxLayout):  
    id1=StringProperty()
    def __init__(self):
        super(Page, self).__init__()
        self.id1="ellow"
        self.img="logo.jpg"

class SimpleKivyApp(App):
    def build(self):
        Builder.load_string(kv_text)     
        return Page()

if __name__ == '__main__':
    SimpleKivyApp().run()

根据我的询问:

 update Table_name set c_name = concat( 
    Replace( 
       Replace( c_name, concat('RemovedStr',','), '' ), 
        concat(',' ,'RemovedStr'), '' 
    ), 
   'AddedStr' 
) [where condition];