Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Compare two Table

Compare two Table

Scheduled Pinned Locked Moved Visual Basic
databasetutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zaimah
    wrote on last edited by
    #1

    Iv got 2 sql tables.. table1 - date, runNo, coop 20090101 C1234 B0018 20090211 C1234 B0150 20090228 C5678 BRT10 20090228 C5678 BP001 table2 - coop, runNo B0001 C1111 B0002 C2222 B0018 C1234 B0144 C5555 B0150 BRT10 BP001 C5678 BP110 C8888 I have to check in table1 for coop wif runNo wether the coop in table2 got that runNo and display the one that dont have runNo like the one in table1. Table1 is data that i extract from a file. all the list in that file means that coop have files for running number . so for table2 are the list of files in portal. so i must checked wether coop in portal got the rite file that is for table2, coop must have runNo .. if the coop in portal (table2) dont have that file(runNo) than i have to display the coop that dont have that runNo. I dont how to compare bcos its not comparing the 1st row in table1 to 1st row in table2. the flow is to search data in 1st row of table1 within table2..

    L 1 Reply Last reply
    0
    • Z zaimah

      Iv got 2 sql tables.. table1 - date, runNo, coop 20090101 C1234 B0018 20090211 C1234 B0150 20090228 C5678 BRT10 20090228 C5678 BP001 table2 - coop, runNo B0001 C1111 B0002 C2222 B0018 C1234 B0144 C5555 B0150 BRT10 BP001 C5678 BP110 C8888 I have to check in table1 for coop wif runNo wether the coop in table2 got that runNo and display the one that dont have runNo like the one in table1. Table1 is data that i extract from a file. all the list in that file means that coop have files for running number . so for table2 are the list of files in portal. so i must checked wether coop in portal got the rite file that is for table2, coop must have runNo .. if the coop in portal (table2) dont have that file(runNo) than i have to display the coop that dont have that runNo. I dont how to compare bcos its not comparing the 1st row in table1 to 1st row in table2. the flow is to search data in 1st row of table1 within table2..

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Not sure I understood correctly, but it seems a simple SQL statement can do it, by joining (JOIN) both tables on their coop fields, then filtering (WHERE) on different runNo fields. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


      Z 1 Reply Last reply
      0
      • L Luc Pattyn

        Not sure I understood correctly, but it seems a simple SQL statement can do it, by joining (JOIN) both tables on their coop fields, then filtering (WHERE) on different runNo fields. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


        Z Offline
        Z Offline
        zaimah
        wrote on last edited by
        #3

        thank u so much.. never think of join the tables.. do u have any link that explain on how to use JOIN? iv been trying to google it but most of the explanation r not clear.. tq :-D

        S 1 Reply Last reply
        0
        • Z zaimah

          thank u so much.. never think of join the tables.. do u have any link that explain on how to use JOIN? iv been trying to google it but most of the explanation r not clear.. tq :-D

          S Offline
          S Offline
          Sebastian Br
          wrote on last edited by
          #4

          Look here: http://www.w3schools.com/Sql/sql_join.asp[^] http://www.w3schools.com/Sql/sql_join_inner.asp[^]

          Z 1 Reply Last reply
          0
          • S Sebastian Br

            Look here: http://www.w3schools.com/Sql/sql_join.asp[^] http://www.w3schools.com/Sql/sql_join_inner.asp[^]

            Z Offline
            Z Offline
            zaimah
            wrote on last edited by
            #5

            got it.. thanks a lot :-D

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups