表A有段ID格式如下数字.数字数字的位数不定加入我要查
前面数字以2开头,后面数字以3结尾的记录怎么查

解决方案 »

  1.   

    试试
    where col like '2%3'
      

  2.   

    select *from tbl where col like '2%' and col like '%3'
      

  3.   

    select *from tbl where ip like '%...%'????
      

  4.   

    不知道你要怎么匹配你自己看看这个:http://security.zdnet.com.cn/security_zone/2011/0305/2019247.shtml
      

  5.   

    sql帮助也是这么写的,可是我不会啊,让你匹配字符串中有“若干位”数字的记录
    比如:
    12
    5a
    b9732
    fda8opi
    这样的都要匹配
    就是这个“若干位”我不会搞啊
      

  6.   


    select * from 
    (
    select '123.221.125.361' as ip
    union all
    select '192.168.1.1'
    union all
    select '192.168.1.abc'
    union all
    select '192.168.1'
    ) t
    where  len(ip)-len(replace(ip,'.',''))=3 and isnumeric(replace(ip,'.',''))=1
      

  7.   

    select * from 
    (
    select '123.221.125.361' as ip
    union all
    select '192.168.1.1'
    union all
    select '192.168.1.abc'
    union all
    select '192.168.1'
    ) t
    where  len(ip)-len(replace(ip,'.',''))=3 and isnumeric(replace(ip,'.',''))=1
    and len(ip) between 7 and 15
      

  8.   

    select * from where col like 2%[.]%3
      

  9.   

    我擦 我写简单了你是要判断数字格式还是判断ip地址啊
    ip判断很麻烦的。的写一个存储过程。
      

  10.   

    判断含有数字是吧
    where patindex('%[0-9]%',name)>0
      

  11.   

    我承认你又对了,能用like的方式写一个吗?
    马上结账
      

  12.   


     where name like '%[0-9]%'
    才20分好吧祈祷好人有好报,祝福我明天面试顺利吧
      

  13.   


    石榴姐姐你好坏啊~~~~~~~~~~~
    where len(col)-len(replace(col,'.',''))=1要不要判断其它数字都是0 啊
      

  14.   

    能like出来吗?
    我给你另外开贴放分
      

  15.   


    这个还真like 不出来。
      

  16.   

    select * from table where column like '2%' and col like '%3'