SQL Server Performance

wildcards in t-sql

Discussion in 'General Developer Questions' started by rmills, Feb 24, 2006.

  1. rmills New Member

    Is there a way to select all rows where a field is four numeric characters?

    Rob Mills
  2. joechang New Member

    can you give some examples of what constitutes four numeric char, and what does not
  3. Twan New Member

    do you mean


    where field1 like '[0-9][0-9][0-9][0-9]'


    Twan
  4. Madhivanan Moderator

    What is the datatype of that column?

    If it is not varchar or char, then

    where col between 1000 and 9999

    Madhivanan

    Failing to plan is Planning to fail
  5. rmills New Member

    Thanks Twan - that's what I was looking for. Madhivanan, yes, the column is a varchar type but maybe that would still work. I'll try it out.

    Rob Mills

Share This Page