Monday, July 21, 2008

QUERY ON VARCHAR COLUMN WHERE VALUE CONTAINS '%'

If a select statement is issued using a "%" in the where clause, the results
are incorrect. For instance, if select is issued as:
select * from emp where ename like '%';
all rows are returned.So, What we have to do,
select * from emp where instr(ename, '%') <> 0;

No comments:

search engine

Custom Search