Consider following two queries
1) SELECT * FROM MYSTORIES WHERE STORY LIKE 'X'
2) SELECT * FROM MYSTORIES WHERE STORY ='X'
Both will find the exact match and give the same result. However some interesting things are
1) The first query doesn't work on DB2 but works on Oracle.
2) The second query works fine on both DB2 and Oracle.
3) There is a performance overhead in using like without a wild card (i.e %)
4) Any good optimizer would reduce the first expression to the second.
Note that in the above example the field 'STORY' is of data type CHARACTER
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment