判断字段中是否包含中文的方法

发表于:2007-06-22来源:作者:点击数: 标签:
SQL > create table test(a varchar2(10)); Table created. SQL> insert into test values('鸟'); 1 row created. SQL> commit; Commit complete. SQL> insert into test values('深刻'); 1 row created. SQL> commit; Commit complete. SQL> insert into te

   
  SQL> create table test(a varchar2(10));
  
  Table created.
  
  SQL> insert into test values('鸟');
  
  1 row created.
  
  SQL> commit;
  
  Commit complete.
  

  SQL> insert into test values('深刻');
  
  1 row created.
  
  SQL> commit;
  
  Commit complete.
  
  SQL> insert into test values('aaa');
  
  1 row created.
  
  SQL> insert into test values('bbb');
  
  1 row created.
  
  SQL> commit;
  
  Commit complete.
  
  SQL> select a from test;
  A
  ----------
  鸟
  深刻
  aaa
  bbb
  
  SQL> select a from test where asciistr(a) like '%\%';
  A
  ----------
  鸟
  深刻
  
  SQL> select a from test where asciistr(a) not like '%\%';
  A
  ----------
  aaa
  bbb

原文转自:http://www.ltesting.net