需要在SQL中查询name字节长度小于4的语句怎么写?

解决方案 »

  1.   

    select * from 表 where datalength(name)<4
      

  2.   

    正解或
    select * from 表 where len(name)<4
      

  3.   

    select * from 表 where datalength(name)<4
      

  4.   


    select * from 表 where len(name)<4
      

  5.   

    select * from 表 where len(name)<4
      

  6.   

    SELECT  * FROM dbo.A WHERE len(ISNULL(name, '')) < 4
    SELECT  * FROM dbo.A WHERE datalength(ISNULL(name, '')) < 4
      

  7.   

    SELECT  * FROM dbo.A WHERE len(ISNULL(name, '')) < 4
      

  8.   

    slelect * from table  where len(name)>4
      

  9.   


    --字节长度还是用
    datalength
      

  10.   

    len 是针对字符个数,而datalength是针对字节个数