ql문장like 여러 조건의 쓰기 실례

909 단어

no name
1   lu,li,zhang 
2   zhou,wei,liu 
3   li,fang 

no name  sex
1   li          1
2   lu         0
3   zhou    0
4   zhang  1 


 
    
select * from A where A.name like (select B.name from B where B.sex=1)

----------------------------------------------------------------------------------------------------------------------------
sqlserver
 
    
select distinct a.no,a.name from a,b where charindex(b.name,a.name)>0 and b.sex=1
 
oracle
 
    
select distinct a.no,a.name from a,b where instr(a.name,b.name)>0 and b.sex=1

----- instr() instr('Hello World', 'or')   8

좋은 웹페이지 즐겨찾기