TRIM would be more efficient. Try explain_plan on your queries. Mike On Fri, Aug 14, 2009 at 10:20 AM, DonO <[email protected]> wrote:
> > Would there be a performance difference using either of the > following... > > SELECT * > FROM table > WHERE name LIKE '%test%' > > vs. > > SELECT * > FROM table > WHERE TRIM(name) = 'test' > > My actual query is searching a CHAR field in JDE that stores a number, > but pads it with spaces. I've heard LIKE is not optimal, but wonder if > anyone has anything empirical to back up an opinion. > > For the record, it's been a long time since I did PL/SQL coding and > have been working in MySQL more over the past 7-8 years, so I'm rusty > on Oracle. > > Thanks for any info. > D. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Oracle-PLSQL?hl=en -~----------~----~----~----~------~----~------~--~---
