select title from news where title like N'%毕业生%'

解决方案 »

  1.   

    SQL在4.1之前对中文的支持一直不是很好,4.1以后有了改善.
    在DOS下可以查找到中文,你看到的则是乱码!
    其实有过开发经验的,一看就明白.现在送你两个字符转换类(以前项目用的);
    根据所以用的数据库的编码方式而用.
    public static String iso8859togbk(String in) throws Exception{   String re=null;
       try {
         re = new String(in.getBytes("iso8859-1"), "gbk");
       }
       catch (Exception e)
       {
         throw new Exception("error in convert charset");
       }
       finally{
         return re;
       }
    }
      public static String iso8859togb2312(String in) throws Exception{   String re=null;
       try {
         re = new String(in.getBytes("iso8859-1"), "gb2312");
       }
       catch (Exception e)
       {
         throw new Exception("error in convert charset");
       }
       finally{
         return re;
       }   
      

  2.   

    --因为你定义的是nvarchar,需要将串转换为Unicode字符select title from news where title like N'%毕业生%'
      

  3.   

    字符集的问题,用
    select title from news where title like N'%毕业生%'