×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    12

    RDbNamedDatabase and LIKE statement

    Hi,

    how does a LIKE query for the RDbNamedDatabase has to look like, for getting a match?

    I have 2 tables for storing some companies and their belonging websites:

    Table company
    id - name
    0 - "ZeroCompany"
    1 - "OneCompany"
    2 - "TwoCompany"

    Table URLs
    id - name - companyid
    0 - "Foo" - 1
    1 - "Bar" - 1
    2 - "Baz" - 1

    Filling the tables and querying works perfectly.

    But querying with a like statement does not work as I expect.

    The following works:
    SELECT * FROM company WHERE name LIKE 'OneCompany'

    The following does not give a match (one is in lowercase).
    SELECT * FROM company WHERE name LIKE 'one'

    The following does not give a match either.
    SELECT * FROM company WHERE name LIKE '%one%'

    Does not work.
    SELECT * FROM company WHERE LOWER(name) LIKE '%onecompany%'

    Does not work too.
    SELECT * FROM company WHERE LOWER(name) LIKE '%one%'



    Can somebody give me a hint for achiving a match with an unsharp query because the name of the company is not known exactly for the calling code.

    Thanks
    makom

  2. #2
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    62

    Re: RDbNamedDatabase and LIKE statement

    HI,

    did u try this:

    SELECT * FROM company WHERE name LIKE '*one*'

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    12

    Re: RDbNamedDatabase and LIKE statement

    Thats what I wanted to know. :-)

    Thanks goldenlife

  4. #4
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    62

    Re: RDbNamedDatabase and LIKE statement

    most welcome

    -Ragini.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×