Hey Guys...
I have a bunch of IDs to delete from a table that contains about 5,000 records. These ID's are in a column called contents and I am trying to filter the table to show just the records that have one of these ids in the contents column so that I can delete the ids from the column.
I came up with a code below which should work but when I got to run it I get a this query is to complex. Any ideas?
Thanks!
I have a bunch of IDs to delete from a table that contains about 5,000 records. These ID's are in a column called contents and I am trying to filter the table to show just the records that have one of these ids in the contents column so that I can delete the ids from the column.
I came up with a code below which should work but when I got to run it I get a this query is to complex. Any ideas?
Thanks!
Code:
SELECT *
FROM TableA
WHERE (((TableA.Contents) Like "**1150-CAR**" Or (TableA.Contents) Like "**1150-CASE**" Or (TableA.Contents) Like "**1150-CHARGER**" Or (TableA.Contents) Like "**1150-HEADSET**" Or (TableA.Contents) Like "**1150-HOLDER**" Or (TableA.Contents) Like "**1150-HOLSTER**" Or (TableA.Contents) Like "**1150-original-battery**" Or (TableA.Contents) Like "**1150-original-HEADSET**" Or (TableA.Contents) Like "**1200-HEADSET**" Or (TableA.Contents) Like "**1200-HOLDER**" Or (TableA.Contents) Like "**1200-HOLSTER**" Or (TableA.Contents) Like "**4NE1-CAR**" Or (TableA.Contents) Like "**510-CAR**" Or (TableA.Contents) Like "**5350-CAR**" Or (TableA.Contents) Like "**5350-CASE**" Or (TableA.Contents) Like "**5350-CHARGER**" Or (TableA.Contents) Like "**5350-HEADSET**" Or (TableA.Contents) Like "**5350-HOLDER**" Or (TableA.Contents) Like "**5350-HOLSTER**" Or (TableA.Contents) Like "**ACBATCHARLGC**" Or (TableA.Contents) Like "**AUDHANAUDHAN21**" Or (TableA.Contents) Like "**AUDHANAUDHAN23**" Or (TableA.Contents) Like "**AUDHANAUDHAN24**" Or (TableA.Contents) Like "**AUDRAPBATCHA1**" Or (TableA.Contents) Like "**AUDRAPBATCHA112**" Or (TableA.Contents) Like "**AUDRAPBATCHA34**" Or (TableA.Contents) Like "**c1300-BATTERIES**" Or (TableA.Contents) Like "**c1300-battery**" Or (TableA.Contents) Like "**c1300-CAR**" Or (TableA.Contents) Like "**c1300-CASE**" Or (TableA.Contents) Like "**c1300-CHARGER**" Or (TableA.Contents) Like "**c1300-earbud**" Or (TableA.Contents) Like "**c1300-HEADSET**" Or (TableA.Contents) Like "**c1300-HOLDER**" Or (TableA.Contents) Like "**c1300-HOLSTER**" Or (TableA.Contents) Like "**c1300-HOME**" Or (TableA.Contents) Like "**C1500-CAR**" Or (TableA.Contents) Like "**C1500-CHARGER**" Or (TableA.Contents) Like "**C1500-HEADSET**" Or (TableA.Contents) Like "**C1500-HOLDER**" Or (TableA.Contents) Like "**C1500-HOLSTER**" Or (TableA.Contents) Like "**C1500-HOME**" Or (TableA.Contents) Like "**C1500-original-HEADSET**" Or (TableA.Contents) Like "**C1500-pouch**" Or (TableA.Contents) Like "**C2000-BATTERIES**" Or (TableA.Contents) Like "**C2000-CAR**" Or (TableA.Contents) Like "**C2000-CASE**" Or (TableA.Contents) Like "**C2000-CHARGER**" Or (TableA.Contents) Like "**C2000-HEADSET**" Or (TableA.Contents) Like "**C2000-HOLDER**" Or (TableA.Contents) Like "**C2000-HOLSTER**" Or (TableA.Contents) Like "**C2000-HOME**" Or (TableA.Contents) Like "**C2000-original-battery**" Or (TableA.Contents) Like "**C2000-original-HEADSET**" Or (TableA.Contents) Like "**c2000-pouch**" Or (TableA.Contents) Like "**CG225-BATTERIES**" Or (TableA.Contents) Like "**CG225-CAR**" Or (TableA.Contents) Like "**CG225-CASE**" Or (TableA.Contents) Like "**CG225-cases**" Or (TableA.Contents) Like "**CG225-CHARGER**" Or (TableA.Contents) Like "**CG225-HEADSET**" Or (TableA.Contents) Like "**CG225-HOLDER**" Or (TableA.Contents) Like "**CG225-HOLSTER**" Or (TableA.Contents) Like "**CG225-HOME**" Or (TableA.Contents) Like "**CG225-original-battery**" Or (TableA.Contents) Like "**CG225-original-HEADSET**" Or (TableA.Contents) Like "**CG225-pouch**" Or (TableA.Contents) Like "**CG300-BATTERIES**" Or (TableA.Contents) Like "**CG300-CAR**" Or (TableA.Contents) Like "**CG300-CHARGER**" Or (TableA.Contents) Like "**CG300-HEADSET**" Or (TableA.Contents) Like "**CG300-HOME**" Or (TableA.Contents) Like "**CG300-original-battery**" Or (TableA.Contents) Like "**CG300-original-HEADSET**" Or (TableA.Contents) Like "**cg300-pouch**" Or (TableA.Contents) Like "**CLC-30W**" Or (TableA.Contents) Like "**g4010-BATTERIES**" Or (TableA.Contents) Like "**g4010-battery**" Or (TableA.Contents) Like "**g4010-CAR**" Or (TableA.Contents) Like "**g4010-case**" Or (TableA.Contents) Like "**g4010-chargers**" Or (TableA.Contents) Like "**g4010-HEADSET**" Or (TableA.Contents) Like "**g4010-HOLDER**" Or (TableA.Contents) Like "**g4010-HOLSTER**" Or (TableA.Contents) Like "**g4010-home**" Or (TableA.Contents) Like "**g4050-BATTERIES**" Or (TableA.Contents) Like "**g4050-battery**" Or (TableA.Contents) Like "**g4050-CAR**" Or (TableA.Contents) Like "**g4050-case**" Or (TableA.Contents) Like "**g4050-chargers**" Or (TableA.Contents) Like "**g4050-HEADSET**" Or (TableA.Contents) Like "**g4050-HOLDER**" Or (TableA.Contents) Like "**g4050-HOLSTER**" Or (TableA.Contents) Like "**g4050-home**" Or (TableA.Contents) Like "**GENLEATCASLU**" Or (TableA.Contents) Like "**HFLG33023OEM**" Or (TableA.Contents) Like "**HOLCLIPCARMO**" Or (TableA.Contents) Like "**L1400-CAR**" Or (TableA.Contents) Like "**L1400-CASE**" Or (TableA.Contents) Like "**L1400-CHARGER**" Or (TableA.Contents) Like "**l1400-earbud**" Or (TableA.Contents) Like "**L1400-HEADSET**" Or (TableA.Contents) Like "**L1400-HOLDER**" Or (TableA.Contents) Like "**L1400-HOLSTER**" Or (TableA.Contents) Like "**L1400-HOME**" Or (TableA.Contents) Like "**L3BLITIONBAT**" Or (TableA.Contents) Like "**LBOEMLIIONBA**" Or (TableA.Contents) Like "**lg-1150**" Or (TableA.Contents) Like "**LG4NE1**" Or (TableA.Contents) Like "**LG4NE11**" Or (TableA.Contents) Like "**LG4NE12**" Or (TableA.Contents) Like "**LG4NE1BATTERY**" Or (TableA.Contents) Like "**LG4NE1CASE**" Or (TableA.Contents) Like "**LG4NE1CHARGERS**" Or (TableA.Contents) Like "**LG4NE1HEADSETS**" Or (TableA.Contents) Like "**LG4NE1HOLSTER**" Or (TableA.Contents) Like "**LG4NE1HOLSTERS**" Or (TableA.Contents) Like "**LG4NE1-ORIGINAL**" Or (TableA.Contents) Like "**LG510**" Or (TableA.Contents) Like "**LG510HOLSTER**" Or (TableA.Contents) Like "**lg-c1300**" Or (TableA.Contents) Like "**lg-C1500**" Or (TableA.Contents) Like "**lg-C2000**" Or (TableA.Contents) Like "**lg-CG225**" Or (TableA.Contents) Like "**lg-cg300**" Or (TableA.Contents) Like "**LGDESKTOP**" Or (TableA.Contents) Like "**lg-g4010**" Or (TableA.Contents) Like "**lg-g4050**" Or (TableA.Contents) Like "**LGICLGLGIC25**" Or (TableA.Contents) Like "**lg-L1400**" Or (TableA.Contents) Like "**LGLGICDMSPV1**" Or (TableA.Contents) Like "**LGLUCGOLDMSP**" Or (TableA.Contents) Like "**LG-LX1200**" Or (TableA.Contents) Like "**LG-LX5350**" Or (TableA.Contents) Like "**LGVX10AC**" Or (TableA.Contents) Like "**LGVX10CAR**" Or (TableA.Contents) Like "**LGVX10CASE**" Or (TableA.Contents) Like "**LGVX10HEADSETS**" Or (TableA.Contents) Like "**LGVX10HOLSTER**" Or (TableA.Contents) Like "**LGVX10HOLSTERS**" Or (TableA.Contents) Like "**LGVX1AC**" Or (TableA.Contents) Like "**LGVX1CAR**" Or (TableA.Contents) Like "**LGVX1CHARGERS**" Or (TableA.Contents) Like "**LGVX1HEADSETS**" Or (TableA.Contents) Like "**LGVX1HOLSTER**" Or (TableA.Contents) Like "**LGVX1HOLSTERS**" Or (TableA.Contents) Like "**LGVX1LEAT**" Or (TableA.Contents) Like "**LG-vx3200**" Or (TableA.Contents) Like "**lg-vx3200-car**" Or (TableA.Contents) Like "**lg-VX3300**" Or (TableA.Contents) Like "**lg-VX3400**" Or (TableA.Contents) Like "**lg-VX3450**" Or (TableA.Contents) Like "**LG-vx4500**" Or (TableA.Contents) Like "**LG-vx4600**" Or (TableA.Contents) Like "**lg-VX4650**" Or (TableA.Contents) Like "**lg-VX4700**" Or (TableA.Contents) Like "**lg-VX5200**" Or (TableA.Contents) Like "**LG-VX6000**" Or (TableA.Contents) Like "**LG-VX6000-car**" Or (TableA.Contents) Like "**LG-VX6000-chargers**" Or (TableA.Contents) Like "**lg-vx6000-home**" Or (TableA.Contents) Like "**lg-VX6100**" Or (TableA.Contents) Like "**LUCGOLLGLGGE**" Or (TableA.Contents) Like "**LX1200-BATTERIES**" Or (TableA.Contents) Like "**LX1200-CAR**" Or (TableA.Contents) Like "**LX1200-CASE**" Or (TableA.Contents) Like "**LX1200-CHARGER**" Or (TableA.Contents) Like "**LX1200-HOME**" Or (TableA.Contents) Like "**LX5350-BLUE**" Or (TableA.Contents) Like "**LX5350-SILVER**" Or (TableA.Contents) Like "**NONAME1**" Or (TableA.Contents) Like "**OEMAUDLITION110**" Or (TableA.Contents) Like "**OEMAUDLITION19**" Or (TableA.Contents) Like "**OEMAUDLITION21**" Or (TableA.Contents) Like "**original-VX3200-battery**" Or (TableA.Contents) Like "**original-VX3300**" Or (TableA.Contents) Like "**original-VX3400**" Or (TableA.Contents) Like "**original-VX3400-extended-battery**" Or (TableA.Contents) Like "**original-VX3450**" Or (TableA.Contents) Like "**original-VX3450-extended-battery**" Or (TableA.Contents) Like "**original-VX3450-holster**" Or (TableA.Contents) Like "**original-VX4650**" Or (TableA.Contents) Like "**original-VX4650-extended-battery**" Or (TableA.Contents) Like "**original-VX4700**" Or (TableA.Contents) Like "**original-vx4700-extended-battery**" Or (TableA.Contents) Like "**original-VX5200**" Or (TableA.Contents) Like "**original-vx6100**" Or (TableA.Contents) Like "**PHONALGLGICL**" Or (TableA.Contents) Like "**RAPBATCHARLG1**" Or (TableA.Contents) Like "**RAPCARCHARLG**" Or (TableA.Contents) Like "**RAPCARCHARLG2**" Or (TableA.Contents) Like "**RAPCARCHARLG3**" Or (TableA.Contents) Like "**SONYCLA**" Or (TableA.Contents) Like "**sony-m2300-battery**" Or (TableA.Contents) Like "**VX10-ANTENNA**" Or (TableA.Contents) Like "**VX10-BLUE**" Or (TableA.Contents) Like "**VX10-CASE**" Or (TableA.Contents) Like "**VX10-CHARGER**" Or (TableA.Contents) Like "**VX10-SILVER**" Or (TableA.Contents) Like "**VX1-ANTENNA**" Or (TableA.Contents) Like "**VX1-BLUE**" Or (TableA.Contents) Like "**VX1-CAR**" Or (TableA.Contents) Like "**vx1-case**" Or (TableA.Contents) Like "**VX1-ORIGINAL**" Or (TableA.Contents) Like "**vx3200-BATTERIES**" Or (TableA.Contents) Like "**vx3200-CHARGER**" Or (TableA.Contents) Like "**vx3200-HEADSET**" Or (TableA.Contents) Like "**vx3200-HOME**" Or (TableA.Contents) Like "**VX3300-BATTERIES**" Or (TableA.Contents) Like "**VX3300-battery**" Or (TableA.Contents) Like "**VX3300-CAR**" Or (TableA.Contents) Like "**VX3300-CASE**" Or (TableA.Contents) Like "**VX3300-CHARGER**" Or (TableA.Contents) Like "**VX3300-HEADSET**" Or (TableA.Contents) Like "**VX3300-HOME**" Or (TableA.Contents) Like "**VX3400-BATTERIES**" Or (TableA.Contents) Like "**VX3400-battery**" Or (TableA.Contents) Like "**VX3400-CAR**" Or (TableA.Contents) Like "**VX3400-cases**" Or (TableA.Contents) Like "**VX3400-CHARGER**" Or (TableA.Contents) Like "**VX3400-HEADSET**" Or (TableA.Contents) Like "**VX3400-HOME**" Or (TableA.Contents) Like "**VX3400-pouch**" Or (TableA.Contents) Like "**VX3450-BATTERIES**" Or (TableA.Contents) Like "**VX3450-battery**" Or (TableA.Contents) Like "**VX3450-CAR**" Or (TableA.Contents) Like "**VX3450-CASE**" Or (TableA.Contents) Like "**VX3450-cases**" Or (TableA.Contents) Like "**VX3450-CHARGER**" Or (TableA.Contents) Like "**VX3450-HEADSET**" Or (TableA.Contents) Like "**VX3450-HOLDER**" Or (TableA.Contents) Like "**VX3450-HOLSTER**" Or (TableA.Contents) Like "**VX3450-HOME**" Or (TableA.Contents) Like "**VX3450-pouch**" Or (TableA.Contents) Like "**vx4500-BATTERIES**" Or (TableA.Contents) Like "**vx4500-BATTERY**" Or (TableA.Contents) Like "**vx4500-CAR**" Or (TableA.Contents) Like "**vx4500-CHARGER**" Or (TableA.Contents) Like "**vx4500-HEADSET**" Or (TableA.Contents) Like "**vx4500-HOME**" Or (TableA.Contents) Like "**VX4500-pouch**" Or (TableA.Contents) Like "**vx4500-premium-car**" Or (TableA.Contents) Like "**vx4500-silver-car**" Or (TableA.Contents) Like "**vx4600-BATTERIES**" Or (TableA.Contents) Like "**vx4600-BATTERY**" Or (TableA.Contents) Like "**vx4600-CAR**" Or (TableA.Contents) Like "**vx4600-CASE**" Or (TableA.Contents) Like "**vx4600-CHARGER**" Or (TableA.Contents) Like "**vx4600-HEADSET**" Or (TableA.Contents) Like "**vx4600-HOME**" Or (TableA.Contents) Like "**vx4600-premium-car**" Or (TableA.Contents) Like "**vx4600-silver-car**" Or (TableA.Contents) Like "**VX4650-BATTERIES**" Or (TableA.Contents) Like "**VX4650-battery**" Or (TableA.Contents) Like "**VX4650-CAR**" Or (TableA.Contents) Like "**VX4650-CHARGER**" Or (TableA.Contents) Like "**VX4650-HEADSET**" Or (TableA.Contents) Like "**VX4650-HOME**" Or (TableA.Contents) Like "**VX4650-pouch**" Or (TableA.Contents) Like "**VX4700-BATTERIES**" Or (TableA.Contents) Like "**VX4700-battery**" Or (TableA.Contents) Like "**VX4700-CAR**" Or (TableA.Contents) Like "**VX4700-CHARGER**" Or (TableA.Contents) Like "**vx4700-door**" Or (TableA.Contents) Like "**VX4700-HEADSET**" Or (TableA.Contents) Like "**VX4700-HOME**" Or (TableA.Contents) Like "**vx4700-pouch**" Or (TableA.Contents) Like "**VX5200-BATTERIES**" Or (TableA.Contents) Like "**VX5200-battery**" Or (TableA.Contents) Like "**VX5200-CAR**" Or (TableA.Contents) Like "**VX5200-CHARGER**" Or (TableA.Contents) Like "**VX5200-HEADSET**" Or (TableA.Contents) Like "**VX5200-HOME**" Or (TableA.Contents) Like "**VX5200-pouch**" Or (TableA.Contents) Like "**VX6000-BATTERIES**" Or (TableA.Contents) Like "**vx6000-battery**" Or (TableA.Contents) Like "**vx6000-car**" Or (TableA.Contents) Like "**VX6000-CASE**" Or (TableA.Contents) Like "**VX6000-HEADSET**" Or (TableA.Contents) Like "**VX6000-HOLDER**" Or (TableA.Contents) Like "**VX6000-HOLSTER**" Or (TableA.Contents) Like "**vx6000-premium-car**" Or (TableA.Contents) Like "**VX6100-BATTERIES**" Or (TableA.Contents) Like "**VX6100-battery**" Or (TableA.Contents) Like "**VX6100-CAR**" Or (TableA.Contents) Like "**VX6100-CHARGER**" Or (TableA.Contents) Like "**VX6100-HEADSET**" Or (TableA.Contents) Like "**VX6100-HOLDER**" Or (TableA.Contents) Like "**VX6100-HOLSTER**" Or (TableA.Contents) Like "**VX6100-HOME**" Or (TableA.Contents) Like "**8700g-car-adapter**" Or (TableA.Contents) Like "**8703e-premium-car**" Or (TableA.Contents) Like "**8703e-car-adapter**" Or (TableA.Contents) Like "**7130e-car-adapter**" Or (TableA.Contents) Like "**7100i-car-adapter**" Or (TableA.Contents) Like "**8703e-BATTERIES**" Or (TableA.Contents) Like "**7130e-BATTERIES**" Or (TableA.Contents) Like "**8703e-chargers**" Or (TableA.Contents) Like "**7130e-premium-car**" Or (TableA.Contents) Like "**7100i-premium-car**" Or (TableA.Contents) Like "**8700g-premium-car**" Or (TableA.Contents) Like "**8700g-BATTERIES**" Or (TableA.Contents) Like "**7100i-BATTERIES**" Or (TableA.Contents) Like "**8703e-extended**" Or (TableA.Contents) Like "**8703e-std-battery**" Or (TableA.Contents) Like "**7100i-std-battery**" Or (TableA.Contents) Like "**7130e-std-battery**" Or (TableA.Contents) Like "**8700g-std-battery**" Or (TableA.Contents) Like "**8700g-milante-case**" Or (TableA.Contents) Like "**8703e-milante-case**" Or (TableA.Contents) Like "**7100i-horizontal-case**" Or (TableA.Contents) Like "**7130e-horizontal-case**" Or (TableA.Contents) Like "**8700g-original-case**" Or (TableA.Contents) Like "**8703e-original-case**" Or (TableA.Contents) Like "**7100i-original-HOLSTER**" Or (TableA.Contents) Like "**8703e-case**" Or (TableA.Contents) Like "**8700g-case**" Or (TableA.Contents) Like "**7130e-cases**" Or (TableA.Contents) Like "**7100i-cases**" Or (TableA.Contents) Like "**7100i-chargers**" Or (TableA.Contents) Like "**7130e-chargers**" Or (TableA.Contents) Like "**8700g-chargers**" Or (TableA.Contents) Like "**original-blackberry-7100i-earbud**" Or (TableA.Contents) Like "**original-blackberry-7130e-earbud**" Or (TableA.Contents) Like "**original-blackberry-8700g-earbud**" Or (TableA.Contents) Like "**original-blackberry-8703e-earbud**" Or (TableA.Contents) Like "**8700g-HOLSTER**" Or (TableA.Contents) Like "**8703e-HOLSTER**" Or (TableA.Contents) Like "**7100i-HOLDER**" Or (TableA.Contents) Like "**7130e-HOLDER**" Or (TableA.Contents) Like "**8700g-HOLDER**" Or (TableA.Contents) Like "**8703e-HOLDER**" Or (TableA.Contents) Like "**7130e-original-HOLSTER**" Or (TableA.Contents) Like "**8703e-headset**" Or (TableA.Contents) Like "**8700g-headset**" Or (TableA.Contents) Like "**7100i-headset**" Or (TableA.Contents) Like "**7130e-headset**" Or (TableA.Contents) Like "**Blackberry-8703e**" Or (TableA.Contents) Like "**original-8700g-white-wall**" Or (TableA.Contents) Like "**original-7130e-black-wall**" Or (TableA.Contents) Like "**Blackberry-7100i**" Or (TableA.Contents) Like "**Blackberry-7130e**" Or (TableA.Contents) Like "**Blackberry-8700g**" Or (TableA.Contents) Like "**original-7100i-white-wall**" Or (TableA.Contents) Like "**original-7130e-white-wall**" Or (TableA.Contents) Like "**original-7100i-black-wall**" Or (TableA.Contents) Like "**original-8700g-black-wall**" Or (TableA.Contents) Like "**original-8703e-black-wall**" Or (TableA.Contents) Like "**original-8703e-white-wall**" Or (TableA.Contents) Like "**original-7100i**" Or (TableA.Contents) Like "**original-7130e**" Or (TableA.Contents) Like "**original-8700g**"))
ORDER BY TableA.Contents;