sql searching multiple words in a string

前端 未结 8 762
故里飘歌
故里飘歌 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:15

    Oracle SQL:

    There is the "IN" Operator in Oracle SQL which can be used for that:

    select 
        namet.customerfirstname, addrt.city, addrt.postalcode
    from schemax.nametable namet
    join schemax.addresstable addrt on addrt.adtid = namet.natadtid
    where namet.customerfirstname in ('David', 'Moses', 'Robi'); 
    

提交回复
热议问题