Results 1 to 4 of 4

Thread: ?!H

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617
    I have 2 tables with FName LName Address, City
    Want to see whether one is a subset of the other

    select count(*)
    from firsttable
    where Rtrim(Ltrim(Upper(LName))) + " " + Rtrim(Ltrim(Upper(FName))) + " " + Rtrim(Ltrim(Upper(Address1))) + " " + Rtrim(Ltrim(Upper(City)))
    in (select
    Rtrim(Ltrim(Upper(LName))) + " " + Rtrim(Ltrim(Upper
    (FName))) + " " + Rtrim(Ltrim(Upper(Address1))) + " " +
    Rtrim(Ltrim(Upper(City)))

    from secondtblSingularsExtracted)

    No primary key or anything..

    How can we speed this up??

    Any ideas welcome

  2. #2
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    Just a thought, because it's hard to be sure without dabbling with this one, but how about Selecting count(*) from the first table and then use a large Left Outer Join that joins the 2 tables on FName LName Address, City - that is if you are using SQL..........?


  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008

    UNION query

    Check the record counts of both tables and then do a UNION query - If the record count is no bigger than either table then one is a super set of the other. That may be quicker, depends on your data.

    Also index the tables - it will speed it up.

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ...

    Thanks to all...

Posting Permissions

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



Click Here to Expand Forum to Full Width