CREATE temporary TABLE tTempCsv
(
MailAddr varchar(100),
UserName varchar(50),
Etc1 varchar(100),
Etc2 varchar(100),
Etc3 varchar(100),
Etc4 varchar(100),
Etc5 varchar(100)
);
truncate tTempCsv;
LOAD DATA INFILE 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\mail_list.csv' into TABLE tTempCsv
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
ESCAPED BY '"' LINES TERMINATED BY '\r\n'
(@col1, @col2, @col3, @col4, @col5, @col6, @col7)
set MailAddr = @col1, UserName= @col2, Etc1=@col3, Etc2=@col4, Etc3=@col5, Etc4=@col6, Etc5=@col7;
SELECT * FROM tTempCsv order by MailAddr desc limit 100;