Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Basic MySQL. XOR?



I was at work stuck using Access and it's GUI and just couldn't my query 
to work right.  There's an automatic join when you add tables and I didn't 
feel like using that app anyway.  I'm on a box with lots of software I 
don't like and I'm not root.  So I thought I'd ask the BLU list prior to 
running to my house and doing this on my home computer.  I kind of did 
what Seth said with success.

SELECT csv1.*, csv2.varA FROM csv1, csv2
WHERE csv1.varA = csv2.varA
AND csv1.varB = csv2.varB
AND csv1.varC = csv2.varC
INTO blah blah blah

Stuck the info into a table,

LOAD DATA LOCAL INFILE 'C:\\MyWorks...equalTextRows.csv'
INTO TABLE notsettheory.scratchpad

So now that I had where the two intersect in table scratchpad I just did 
this to both tables,

DELETE csv1.* FROM csv1, scratchpad
WHERE scratchpad.varA = csv1.varA
AND scratchpad.varB = csv1.varB

It's pretty simple but it worked.  I now know exactly where these two 
people disagree.

What is this beast?

% diff --old-line-format=%L --new-line-format=%L
--unchanged-line-format="" data1.csv data2.csv > diff.csv

Oh my, hieroglyphics!  I shall read more about diff/grep.  I'm sure it 
will come in handy.

Thanks for your help.

- Eric.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org