sql数据库吧 关注:365贴子:570
  • 2回复贴,共1

查询名字中分别包含国和芳

只看楼主收藏回复

查询名字中分别包含国和芳,效果是
姓名 包含
王国 国
林芳 芳


IP属地:浙江1楼2019-12-08 22:27回复
    select stuname as 姓名,(case
    when stuname like '%幂%' then '幂'
    when stuname like '%峰%' then '峰'
    end ) as 包含
    from student where stuname like '%幂%'
    or stuname like '%峰%' ;


    IP属地:山东2楼2019-12-10 10:20
    回复
      用模糊查询啊


      IP属地:河南3楼2020-02-24 20:33
      回复