sql searching multiple words in a string

前端 未结 8 763
故里飘歌
故里飘歌 2020-12-09 02:35

What is the most efficient and elegant SQL query looking for a string containing the words \"David\", \"Moses\" and \"Robi\". Assume the table is named T an

8条回答
  •  半阙折子戏
    2020-12-09 03:02

    if you put all the searched words in a temporaray table say @tmp and column col1, then you could try this:

    Select * from T where C like (Select '%'+col1+'%' from @temp);
    

提交回复
热议问题