回覆列表
-
1 # 使用者9686238245148
-
2 # 小蘋果手機
替換SQL欄位中的換行符,回車符:
1> 回車符SELECT *, REPLACE(detail, CHAR(13) , "") AS 顯示替換後的內容 FROM loginfo[sybase t-sql 語法如下:]SELECT *, str_REPLACE(detail, CHAR(13) , "") AS 顯示替換後的內容 FROM loginfo?
2>換行符SELECT *, REPLACE(detail, CHAR(10), "") AS 顯示替換後的內容 FROM loginfo[sybase t-sql 語法如下:]SELECT *, STR_REPLACE(detail, CHAR(10), "") AS 顯示替換後的內容 FROM loginfo?
3>回車換行符SELECT *, REPLACE(detail, CHAR(13) + CHAR(10), "") AS 顯示替換後的內容 FROM loginfo[sybase t-sql 語法如下:]SELECT *, STR_REPLACE(detail, CHAR(13) +CHAR(10), "") AS 顯示替換後的內容 FROM loginfo4>將回車換行符替換成UPDATE loginfo SET detail = REPLACE(detail, CHAR(13) + CHAR(10), "")注在dos \win 系列會出現 回車+換行符 CHAR(13)+CHAR(10)在unix \ linux 是換行符轉換隻要把回車符char(13) 去掉就行了以下sql語句UPDATE loginfo SET detail = REPLACE(detail, CHAR(13) , "")
Select * from xxx where xxxx=""
空不是null 如果是null可以 select * from xxx where Xxxx is null
當然你也可以2句結合起來,
Where isnull(xxx,"")=""