??????д????????Oracle???????????????Oracle?е?????“’”???????????????“’”??????????????????????????????????????????????λ??“%”??“_”???
???????????????Oracle?в?????????????“’”?????“%”??“_”????????÷?б??“”???????????????????б??“”??????????
??????????tb??????col?????col?в??????“%”??“_”???????Σ?sql???£?
????-- Oracle
????select * from tb where col like '%\%%' or col like '%\_%' escape ''
????sql??“escape”??????????б??“”??????????????“”???“%”???“%”????????????????“%”??????????λ????
???????“%”??“_”????λ??????????where????????select ‘%’ from dual??????????
??????MySQL???????С??????MySQL????д“escape”????????÷?б??“”???????
????-- MySQL
????select * from tb where col like '%\%%' or col like '%\_%'
???????????????μ?????“’”?????????Oracle????????????????“’”?????????“’”????????????MySQL?п???????????“’”???б??“”?????????“’”??????????
????sql???£?
-- Oracle
select '''' from dual;
select * from tb where col like '%''%'
-- MySQL
select '''' from dual;
select * from tb where col like '%''%'
-- or
select ''' from dual;
select * from tb where col like '%'%'