请帮忙看看下面查询语句要怎么写
我要查询的条件是一串数字:9788591511916查询的表是product,字段是ProdcutMark字段的是是这样的:
ISBN 978-8-5915-1191-6/T·30
ISBN 978-8-5815-1191-6/T·37
ISBN 978-8-5715-1191-6/T·30
ISBN 988-8-5915-1191-6/T·35
ISBN 978-8-5915-1191-6/T·38
ISBN 978-8-5985-1191-6/T·39我要把这条记录ISBN 978-8-5915-1191-6/T·30查询出来要怎么写SQL语句

解决方案 »

  1.   

    SELECT * FROM product where replace (ProdcutMark,'-','') like '%9788591511916%'
      

  2.   

    就是这种格式么?长度也固定??SELECT SUBSTRING(REPLACE('ISBN 978-8-5985-1191-6/T·39','-',''),6,LEN(REPLACE('ISBN 978-8-5985-1191-6/T·39','-',''))-10)9788598511916
      

  3.   


    Select Replace(SUBSTRING(ProdcutMark,6,23),'-','') as sPro From product where product='ISBN 978-8-5915-1191-6/T·30'
      

  4.   

    SELECT * FROM product where 
    ProdcutMark  like  '%'+stuff(stuff(stuff(stuff('9788591511916',4,0,'-'),6,0,'-'),11,0,'-'),16,0,'-')+'%'
      

  5.   


    Select *  From product where Replace(SUBSTRING(ProdcutMark,6,23),'-','')='9788591511916'
      

  6.   

    select * from product where charindex('9788591511916',replace (ProdcutMark,'-',''))>0