在我的一个数据库中有表A,表A中有“班级”这样一个字段,班级字段的内容是字符串,
字符串是这样的,如:“一年级一班二年级一班三年级二班”这样的字符串
这个SQL语句是slect * from a where “班级”包函“一年级一班”?
请问这个where条件怎么写啊,其实就是一个字符串函数!

解决方案 »

  1.   

    slect * from a where 班级 like '%一年级一班%'
      

  2.   

    select * from a where "班级" like "%一年级一班%"  
    数据多的话速度慢
      

  3.   

    不是很理解楼主的意思,是不是这样:
    slect * from a where 班级 in('一年级一班','一年级二班')
      

  4.   

    select * from a where 班级 like '%一年级一班%'
      

  5.   

    slect * from a where 班级 like '%一年级一班%'
      

  6.   

    select * from a where 班级 in('一年级一班')
    好像是这个样子吧!
      

  7.   

    select * from a where 班级 like '%一年级一班%'