-
August 1st, 2009, 07:05 PM #1Member
- Join Date
- Mar 2005
- Posts
- 93
Database: Comparing values in two different tables
Hello all,
I hope someone can answer this question!
I am trying to compare two columns from a table with one column from another table. I need to have the rows from the first table that aren't contained in the second table.
The "problem" is that I have around 800K records on each table.
Has anyone tried to do this in a home computer (2 Gb RAM 1.79 GHz Centrino Duo)?
If you have, how long did it take?
If you haven't, what's your guess? How long will it take?
The DBMS is MySQL running on Windows.
Thank you all!!!
-
August 1st, 2009, 07:43 PM #2Not Really a Member
- Join Date
- Oct 2001
- Posts
- 27,856
how long it will take is heavily dependant on if the columns are indexed
I think mysql now supports 'join' syntax?
you could do something as simple as
select *
from t1
left outer join t2
on t1.column1 = t2.column1
obviously changing the table/column names
this is written for t-sql so some minor syntax changes maybe necessary for mysql
what you're asking for is a pretty common outer join
it maybe a right outer join, so if left doesn't give you the correct results try a right outer joinHelicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
-
August 9th, 2009, 09:58 AM #3Code:
I've always done: select t1.column1, t1.column2 from table t1 where not exists (select 'x' from table t2 where t1.column1 = t2.column and t1.column2 = t2.column)
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Need values
By TheBigCarp321 in forum Processors, Memory, and OverclockingReplies: 5Last Post: May 2nd, 2006, 10:13 PM -
CHS values on my HD are incorrect.
By hav0c in forum Storage RelatedReplies: 1Last Post: January 5th, 2006, 04:41 AM -
Family values
By Theophylact in forum IMO CommunityReplies: 7Last Post: March 9th, 2004, 02:15 AM -
Conversion Values
By washe in forum Graphic Design and Digital PhotographyReplies: 3Last Post: August 12th, 2002, 07:17 PM



LinkBack URL
About LinkBacks



Reply With Quote

Birth control aside what about Scientology and Jehovah's Witnesses, who eschew most if not all primary care?
Obama care and religious...