LIKE witout spaces

  • Hey all i have a query much like this

     

    SELECT * FROM tbl_test

    WHERE testname LIKE '%Jay%'

    this works..it selects the user Jay if i type in jay but if i type in 'Jay ' with a space the query doesnt work..any ideas on how i can solve this ??

  • hi,

    used the builtin funtions LTRIM, RTRIM to trim the extra spaces on the left or right side.

    hope this will slove your problem

    thanks

    ijaz

    cheers

  • but beware of that leading %... causes full scan of table.

    Thank-you,
    David Russell
    Any Cloud, Any Database, Oracle since 1982

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply