In MySQL v4 it should be possible to use:
First, get the text file into a new temp table
Code:
-- create temp table
CREATE TABLE mytemp (emails VARCHAR(100));
-- insert the emails from the file
LOAD DATA 'emails.txt'
INTO TABLE mytemp;
-- get all emails which are both present in the original table and the temp table
SELECT * FROM emails
WHERE email IN (
SELECT email FROM mytemp
);
With MySQL v3 this could work:
Code:
-- insert the emails from the file
LOAD DATA 'emails.txt'
INTO TABLE emails (email);
-- get all emails which are both present in the original table and the temp table
CREATE TABLE newtable
AS
SELECT ID, DISTINCT Email, `Date` FROM emails;
Bookmarks