模糊查詢帶下劃線和普通模糊查詢能公用一條SQL嗎?怎麼寫?(下面的只能查到帶下劃線的)
select * from table_name t where t.name like '%\_%'escape'\'
if flag then
V_PRO := 'select * from table_name t where t.name like '%_% ';
else
V_PRO := 'select * from table_name t where t.name like '%escape%';
EXECUTE IMMEDIATE V_PRO;
你看這樣行麼。動態語句