View Single Post
Old 04-04-2008, 02:08 PM   #2 (permalink)
Maio
Registered User
 
Join Date: Dec 2004
Posts: 65
-1 Internets
Create a table named `companies` and a column in `adata` named `company_id` that references the companies in `adata` as a foreign key. Then make the comparison on `companies` (which will have less records than `adata` and therefore fasten up the lookup).

SELECT DISTINCT `adata`.`key` FROM `adata` JOIN `companies` ON `adata`.`company_id` = `companies`.`id` WHERE `companies`.`name` LIKE '%MBNA%'
Maio is offline   Reply With Quote

 
Uberguilds Network