Replace function in MySQL

来源:互联网 发布:80端口被占用怎么解决 编辑:程序博客网 时间:2024/04/30 12:18
I want to Replace a column of data to empty if length(column)<6. D1i@@>9sh  
2?85Z$j  
First of all, I searched "Replace" statement 2~$D< ;$H  
+[q&3X9:%  
Replace into test_out_realtime SET `PROGRAM` = replace( PROGRAM, '%', '' ) WHERE length( program ) <6 dv%AX8 G  
MySQL 5 returns "Error", seems Replace cannot use WHERE condition at back... Y7tPq:i z  
|X3B$H  
l;AesFRbw  
then I tried to use UPDATE, it WORKS!! - sKU;+b a  
!(T.+c  
update test_out_realtime xj~_uK /  
set PROGRAM = '' Q1=,Gc&  
where length(PROGRAM) < 6 dF5x>/:  
y ?% ==  
{"Pi=7g<7g  
then !8A^o-+#  
select distinct PROGRAM from test_out_realtime where length(PROGRAM) < 6 e<hS*q]  
It gives me empty, that means I have replaced all Program legnth < 6 to "empty" 
原创粉丝点击