select * from table where 研究方向 like '%计算机%'

解决方案 »

  1.   

    select * from yourtable where column like '%计算机%'
      

  2.   

    那样就把所有的都显示出来了  不能select * 的 
    我是把四个方向每个作为一个字段的
      

  3.   

    我的意思是四个方向里 只有符合查询条件的才显示  其他的不显示  如果select * 会都显示出来
      

  4.   

    select field '研究方向'  from table where field like '%计算机%'
      

  5.   

    select * from yourtable 
    where 
    case when column1 like '%计算机%'  then colunm1
         else '' end,
    case when column2 like '%计算机%'  then colunm2
         else '' end,
    case when column3 like '%计算机%'  then colunm3
         else '' end,
    case when column4 like '%计算机%'  then colunm4
         else '' end
      

  6.   

    小兔子  你的方法我用起来为什么总是出错啊。句子是这样的:
    SQLText = "select * from student_info where case when study_sub_one like '%" & searchtxt & "%'" & " then study_sub_one else '' end, case when study_sub_two like '%" & searchtxt & "%'" & " then study_sub_two else '' end, case when study_sub_three like '%" & searchtxt & "%'" & " then study_sub_three else '' end, case when study_sub_four like '%" & searchtxt & "%'" & " then study_sub_four else '' end"