select * from applyleave where mngid = 'mukesh' In above query applyleave is a table with integer column mngid. above query throws exception "Invalid Number".Because mukesh is a string. Now I used the following query. select * from applyleave where mngid = 'mukesh' and employeeid = '12345'; Employeeid is integer. But it doesnt throws any exception. it runs fine .Can anybody suggest why the second query doesnt throws any exception.