How to join data of both tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GORKAL
    New Member
    • Jul 2015
    • 5

    How to join data of both tables

    Hai i have two tables IN ACESS one rc table and dl table which contains of names,father name and address in both tables which contains of same name in different like in rc table name is shaik jeelan and in dl table name like s jeelan how can i match like this data of both tables
    I AM TRYING USING QUEARY LIKE
    SELECT RC.NAME,DL.NAME ,DL.FATHERNAME, RC.FATHERNAME FROM RC,DL WHERE RC.NAME LIKE '*DL.NAME*' AND DL.FATHERNAME LIKE '*RC.FATHERNAME *', BUT NO RECORDS ARE GETTING
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    In that particular case, you join the first initial of the first name in rc to the letter in dl and the last name in rc to the last name in dl.

    You will need to account for all the variations yourself with code. Whether you decide to hard code all the variations yourself or use a fuzzy matching algorithm, that's up to you. There's no easy way for you to do this. Whatever you choose, prepare to do a lot of complex coding.

    Comment

    • GORKAL
      New Member
      • Jul 2015
      • 5

      #3
      Can u give an example

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        An example of a complex join using your sample data above would be:
        Code:
        table1 INNER JOIN
        table2 ON
        LEFT(table1.FirstName, 1) = table2.FirstInitial AND
        table1.LastName = table2.LastName

        Comment

        • GORKAL
          New Member
          • Jul 2015
          • 5

          #5
          But using above queary i am getting data if names are sane in both tables

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            If by "sane", you mean "same", then that's correct. You want to return names that match and those that match based on the first initial. It's what you said you wanted in the first post.

            Comment

            • GORKAL
              New Member
              • Jul 2015
              • 5

              #7
              Hai thanks for ur reply actually what i want is in one table name will be like mehaboob and in another table name will be like Mahaboob how to use contains or like function in query

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                That's not what you said in the original. It's difficult to answer your questions when you don't give accurate details.

                In your scenario, you will need to use a fuzzy matching algorithm. Which one you choose is up to you but be prepared to do a lot of complex coding.

                You can start with these to get an idea of what you're in for:

                Comment

                Working...