querying WHERE condition to character length?

前端 未结 3 1788
渐次进展
渐次进展 2021-02-04 23:01

I have a database with a large number of words but i want to select only those records where the character length is equal to a given number (in example case 3):



        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-04 23:25

    I think you want this:

    select *
    from dbo.table
    where DATALENGTH(column_name) = 3
    

提交回复
热议问题