SQL 2000 中,查询某个字段的值中第一个字是汉字的语句如何写?

解决方案 »

  1.   

    where left(col,1)a like '[吖-咗]
      

  2.   

    --------------------SQL Server数据格式化工具-------------------
    ---------------------------------------------------------------
    -- DESIGNER :happycell188(喜喜)
    --       QQ :584738179
    -- Development Tool :Microsoft Visual C++ 6.0    C Language 
    -- FUNCTION :CONVERT DATA TO T-SQL
    ---------------------------------------------------------------
    -- Microsoft SQL Server  2005
    -- Developer Edition on Microsoft Windows XP [版本 5.1.2600]
    ---------------------------------------------------------------
    ---------------------------------------------------------------use test
    go
    if object_id('test.dbo.tb') is not null drop table tb
    -- 创建数据表
    create table tb
    (
    id int,
    name char(5)
    )
    go
    --插入测试数据
    insert into tb select 1,'jone'
    union all select 2,'李四'
    union all select 3,'Lili'
    union all select 4,'王五'
    goselect * from tb where ascii(left(ltrim(name),1))>127 or ascii(right(name,1))<0/*
    id  name
    ---------------
    2 李四 
    4 王五(2 行受影响) 
    */
      

  3.   

    '修改一下'
    select * from tb where ascii(left(name,1))>127 or ascii(left(name,1))<0
      

  4.   

    SELECT col WHERE left(col,1) LIKE '[吖-做]%'
      

  5.   

    为什么asc(S)的值是如果负数就说明S就是汉字,而我用select * from tb where ascii(left(name,1))<0却找不到字段值中第一个是汉字的记录?
      

  6.   

    写认真点的说 
    where col  like '[吖-咗]%'
      

  7.   


    SELECT col from 表名 WHERE left(col,1) LIKE '[吖-做]%'楼主试试这个对不对
      

  8.   

    SELECT col from 表名 WHERE left(col,1) LIKE '[吖-做]%'select * from tb where ascii(left(name,1))>127 or ascii(left(name,1))<0
    都对