i need to delete rows from MySQL table which is very huge.I have multiple conditions check before deleting the data. my table looks like: data(table name):
name mobile email address source
xyz 871 a@y.com 1.txt
bac 123 null 2.XLS
TST 456 B@C.COM 3.xls
yup 897 null abcde
web null D@gmail.com hjbsb
so basically i need to delete the rows where value in Source doesnt end with either .TXT or .txt or .xls or .XLS. source is the file-name from which data has been captured.
答案 0 :(得分:5)
Delete from table_xyz where right(lower(source),4) not in ('.txt','.xls','xlsx')