自动生成ROWNUN
SELECT (@rowNO := @rowNo+1) AS rowno,a.uuid
FROM (SELECT * FROM h_log_proc) a,(SELECT @rowNO :=0) b
随机取记录
SELECT * FROM (SELECT (@rowNo :[email protected]+1) AS rowno, pwd FROM pur_admininfo, (SELECT @rowNo := 0) b) tmp WHERE rowno=(SELECT ROUND(RAND() * 10000000 % (SELECT COUNT(*) FROM pur_admininfo))) LIMIT 1
去除水平制表符
#查询
#SELECT * FROM web_h_cus_info WHERE LOCATE(CHAR(10),address)>0;
#去除换行回车符
UPDATE `web_h_cus_info` SET `address` = REPLACE(REPLACE(`address`, CHAR(10),‘‘), CHAR(13),‘‘);
#去除空格
UPDATE `web_h_cus_info` SET `address`=REPLACE(`address`,‘ ‘,‘‘);
#去除水平制表符
UPDATE `web_h_cus_info` SET `address`=REPLACE(`address`,CHAR(9),‘‘);
时间: 2024-10-30 01:18:37