Results 1 to 3 of 3

Thread: LIKE command

  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Unanswered: LIKE command

    Guys,

    I have a list of accounts in table A, which I need to see if they are in table B or not. That's easy, but the problem is that accounts in table A can be in present in different fashion asin table B. Example
    Table A Table B
    123 00123
    1111 984511123
    15677 1567745
    44567 4456700000
    If I had to check single account,I would have used LIKE command as %accountno%. But I am not sure how to do this for batch of account numbers.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by asaini
    Guys,

    I have a list of accounts in table A, which I need to see if they are in table B or not. That's easy, but the problem is that accounts in table A can be in present in different fashion asin table B. Example
    Table A Table B
    123 00123
    1111 984511123
    15677 1567745
    44567 4456700000
    If I had to check single account,I would have used LIKE command as %accountno%. But I am not sure how to do this for batch of account numbers.
    Interesting. How do you know if "984511123" matches "1111" and not "9845" or "1123"? Anyway, I would use the LOCATE() function for a task like this.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Apr 2009
    Posts
    2
    Thanks Nick.

    Ideally I would be linking the accounts from both tables to surnames from "details" table. This would ensure that matching account we found in table 2 infact is related to account in table1.

Posting Permissions

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