how do I get the fields of a column that’s without a match in another column?
I tried:
SELECT table1.page_title
FROM table1, table2
WHERE table1.page_title != table2.page_title
It produces a lot of duplicate fields so I did a:
SELECT DISTINCT table1.page_title
FROM table1, table2
WHERE table1.page_title != table2.page_title
but it just hangs.
Any help would be greatly appreciated, thanks!
P.S.
I’m doing this so I could create an exclude list for mediawiki’s MWDumper tool. I need it so that when I import the outputted sql, my current wiki entries will not be overwritten.
EDIT:
Yes they’re 2 different tables. Each has about 70,000+ records
Also why are my queries slow? I’d appreciate it if someone could clarify so I could learn why 🙂 Thanks again!
Are a and b different tables, both having a “page_title” column?
If so, try this:
If all you’re interested in is removing duplicates (if you only have one table), then there are several ways to do it, two of which are:
or
The GROUP BY option is stronger albeit slower – you can add a HAVING clause to choose only those titles that appear e.g. more than twice:
Hope that helps
(Thanks Aaron F for the comment)