ORACLE 全形數字轉半形數字
資料庫表 test 欄位 id name age
全形數字:123456
半形數字:123456
length和lengthb的區別:
length(123456) 6
lengthb(123456) 12
to_single_byte函式用法:
to_single_byte(123456) 123456
查詢所有全形的數字:
select age from test where lengthB(age) >6
替換全形的為半形的:
update test t1 set t1.age = (select to_single_byte(t2.age) from test t2 where t1.id = t2.id)
ok!!
轉載自:http://lkfnn.iteye.com/blog/200416
相關推薦
ORACLE 全形數字轉半形數字
資料庫表 test 欄位 id name age 全形數字:123456 半形數字:123456 length和lengthb的區別: length(123456) 6 lengthb(123456) 12 to_singl
中文標點符號轉英文標點符號 全形轉半形 String工具類
package com.yl.sf; public class StringUtil { /** * 中文標點符號轉英文字標點符號 * * @param str * 原字串 * @return str 新字串 */ public static
Delphi全形轉半形
function ToDBC( input :String):WideString;varc:WideString;i:Integer;beginc := input;for i:=1 to Length(Input) dobeginif (Ord(c) = 12288) thenbeginc := chr(
Lua UTF-8 全形轉半形
根據UTF-8的編碼規則,可以知道: 1. 全形空格為12288,半形空格為32 2. 其他字元半形(33-126)與全形(65281-65374)的對應關係是:均相差65248 但是UTF-8不能位元組轉換位整型變數,因此需要一個函式,做一個轉換: function
string 全形轉半形
string ToHalf1(string str) { string result = ""; unsigned char tmp; unsigned char tmp1; for (unsigned int i = 0; i < str.le
語料處理之全形轉半形
該指令碼的功能是把文字檔案中的全形字元轉換為半形字元: # -*- coding: utf-8 -*- def strQ2B(inputFilePath,outputFilePath):
PG_全形轉半形函式
CREATE OR REPLACE FUNCTION convertstring(text) RETURNS text AS $$ DECLARE len INTEGER; retval text; tmp text; asciival IN
python 匹配文字全形轉半形字元
在對文字進行處理的時候經常會遇見要對括號和標點進行匹配 常見的英文(半形)符號如( ) 直接用正則匹配即可 但是遇見全形字元(中文括號、標點),直接用正則匹配會存在問題: 因為編碼通常為為utf8,若直接匹配,中文括號的3位元組編碼會和一些中文的位元組編碼重複,產生意想不到
1.04-Java全形轉半形方法
開發十年,就只剩下這套架構體系了! >>>
數據清洗小記(2):全角數字轉換半角數字
大局觀 山東 轉載 亞洲 pop rpm包 stats mod 法律 原創作品。出自 “深藍的blog” 博客,歡迎轉載,轉載時請務必註明出處,否則有權追究版權法律責任。深藍的blog:http://blog.csdn.net/huangyanlong/article/d
sql 全形字元,半形字元查詢
將常用半形轉化為全形: select nchar(65248+unicode( '半形字元 ')) 上面這個方法如果unicode裡面的不是半形字元是全形字元的話就會返回null,然後我們可以利用這個原理進行查詢 select * from 表名 where ncha
全形英文和半形英文切換
win10有時候誤操作會將半形英文變成全形英文 先將輸入法切換到英文輸入法 全形英文就是這樣: abcdefjhigklmnop 半形英文這樣 abcedfjhigk 他們之間怎麼來回切換呢? 按sh
MySQL存全形字元和半形字元的區別
很不巧公司內測IM的時候又遇到MYSQL_DATA_TRUNCATED錯誤,日誌記錄還是在mysql_stmt_fetch呼叫的時候出現的。鑑於之前的經驗,應該是給定的結果集繫結區域長度不夠造成的,反覆
阿拉伯數字轉中文大寫數字的JS
replace lac 16px fun repl span 大寫 font func 1 function intToChinese ( str ) { 2 str = str+‘‘; 3 var len = str.length-1; 4
把中文表示的數字轉成阿拉伯數字
問題描述: 輸入一箇中文字串,使用中文表示的數字形式。如一百,一千萬,四千二百萬零三十。 輸出對應的數字,如100,1000000,42000030。 思路: 遇到這個問題一開始覺得挺簡單的,用一個字串和一個數組對應下標就找到數字
Java將字串中的全形字元轉成對應的半形字元
package com.hung.test; /** * 全形轉半形 * @author hung * */ public class MyQB { /** * @param args */ public static void main(String[] args) {
輸入法中全形輸入轉成半形輸入
我們在網站或者其他位置輸入字元的時候,有時不小心碰到快捷鍵將半形輸入轉換成全形輸入,會造成一些不必要的麻煩,因此在系統登入的時候不管使用者輸入的是全形還是半形,在前端邏輯中 一律轉換成半形字元提交給伺服器。 其實,半形字元(33-126)與全形字元(65281-65374)
oracle如何實現全形和半形的切換
由於日文中有數字數字都是使用的全形形式,導致oracle在處理這些全形字串時會出現失敗的情況,下面我們來了解下oracle提供的轉換函式! 轉換成半形函式: to_single_byte(
java全形字元轉換為半形 半形轉全形
/// <summary> /// 判斷字元是否英文半形字元或標點 /// </summary> /// <remarks> /// 32 空格 /// 33-47 標點 ///
Java Xss半形轉全形防攻擊
/** * 將容易引起xss漏洞的半形字元直接替換成全形字元 * * @param s * @return */ private String xssEncode(String s) { if (s == null || s.equals("")) { return s;