sql searching multiple words in a string

前端 未结 8 764
故里飘歌
故里飘歌 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-09 03:00

    Oracle SQL :

    select * 
    from MY_TABLE
    where REGEXP_LIKE (company , 'Microsodt industry | goglge auto car | oracles    database')
    
    • company - is the database column name.
    • results - this SQL will show you if company column rows contain one of those companies (OR phrase) please note that : no wild characters are needed, it's built in.

    more info at : http://www.techonthenet.com/oracle/regexp_like.php

提交回复
热议问题