个人网站免费域名获取,动态型网站建设哪里便宜,全球品牌网,天津网站建设教程1、mysql截取最后一个字符之前的数据
select
--截取斜杠之前的数据REVERSE(SUBSTR(REVERSE(SPNH-dfg-2012) ;
--截取斜杠后的数据 INSTR(REVERSE(SPNH-fg-2012),-)1))2、mysql获取最后一个字符后的数据
select SUBSTRING_INDEX(SPNH-dfg-2012,-,-1) 3、mysql更新某个字段…1、mysql截取最后一个字符之前的数据
select
--截取斜杠之前的数据REVERSE(SUBSTR(REVERSE(SPNH-dfg-2012) ;
--截取斜杠后的数据 INSTR(REVERSE(SPNH-fg-2012),-)1))2、mysql获取最后一个字符后的数据
select SUBSTRING_INDEX(SPNH-dfg-2012,-,-1) 3、mysql更新某个字段IP
update anchoremc_file_log set
addressreplace(address,192.168.1.29,111.175.140.46);update anchoremc_dailypaper_examine_case set
picture_urlreplace(picture_url,192.168.1.29,111.175.140.46)实例插入语句:
INSERT INTO anchoremc_dailypaper_examine_case_new ( case_code, enterprise_name, enterprise_code, professional, select_device, device_name_wh, inspection_desc, handling_suggestions, problem_pro, inspection_date, picture_url, data_sources )
SELECTcase_code,enterprise_name,enterprise_code,professional,select_device,device_name_wh,inspection_desc,handling_suggestions,problem_pro,CONCAT(year,-,moth,-,day) inspection_date,[] picture_url,(CASE data_sourcesWHEN THEN 3WHEN NULL THEN 3WHEN 人工录入 THEN 1else 0END ) data_sourcesFROManchoremc_dailypaper_examine_case_excelnew;SELECT * FROM anchoremc_dailypaper_examine_case_newwhere inspection_date 2008-01-01;5、更新案例编码
update anchoremc_dailypaper_examine_case
set case_code_preREVERSE(SUBSTR(REVERSE(case_code) , INSTR(REVERSE(case_code),-)1)),case_code_endSUBSTRING_INDEX(case_code,-,-1) ,year_time YEAR(inspection_date),moth_timeMONTH(inspection_date)WHEREyear_time IS NULL6、更新链接
update anchoremc_file_log set addressreplace(address,192.168.1.29,111.175.140.46)
update anchoremc_dailypaper_examine_case set picture_urlreplace(picture_url,192.168.1.29,111.175.140.46)