How do I connect 2 tables ?

Results 1 to 3 of 3

Thread: How do I connect 2 tables ?

  1. #1
    Wolfgang Guest

    Default How do I connect 2 tables ?

    I have 2 tables :<BR>a_tbl<BR>b_tbl<BR><BR>a_tbl with column "username" has 10000 records<BR>b_tbl with column "username" has 3000 records<BR><BR>"username" of b_tbl consists of records originally extracted from "username" in a_tbl<BR><BR>How do I select the remaining 7000 records ?<BR><BR>The following works, but is extremely slow:<BR>SELECT username FROM a_tbl WHERE username NOT IN (SELECT username FROM b_tbl)<BR><BR>The following does not work, and I don&#039t know why, I get no error, it just stops:<BR>SELECT DISTINCTROW username <BR>FROM a_tbl INNER JOIN b_tbl <BR>ON a_tbl.username &#060;&#062; b_tbl.username<BR><BR>Any help/ideas is appreciated.<BR>Wolfgang

  2. #2
    Join Date
    Dec 1969

    Default RE: How do I connect 2 tables ?

    Hope it will help<BR>SELECT a.username,b.username <BR>FROM a_tbl a INNER JOIN b_tbl b<BR>ON a.username &#060;&#062; b.username <BR><BR>

  3. #3
    Wolfgang Guest

    Default RE: How do I connect 2 tables ?

    thanks,<BR>The problem on above code is that I get millions of recordsets, as every single a.username actually is &#060;&#062; to all b.username except one.<BR>It should be some kind of "negative"-join, if that exists...<BR>Wolfgang

Posting Permissions

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