Sorry, my bad... DISTINCT
Aloha,
James
>James,
>
>Try JOIN
SELECT voter.* from voter ;
> JOIN Code ON voter.kVoter = code.kVoter ;
> WHERE code.kCodeType = "{09D0D53C-3F5A-48B0-8B87-BB740565DA0A}" ;
> AND code.cValue="Y "
>
>>Hi All,
>>
>>If I execute the following line, the result (a single recod in this case but now always) comes up quickly (< 1 second):
>>***************
>>SELECT * FROM Code WHERE kCodeType="{09D0D53C-3F5A-48B0-8B87-BB740565DA0A}" AND cValue="Y "
>>***************
>>
>>If I execute the following line, the result comes up fairly quickly (1.2 second). Note the GUID is the result of the above query.:
>>***************
>>SELECT * from voter WHERE kVoter="{C9B43423-4248-4E55-8A05-6F81939FBD50}"
>>***************
>>
>>If I execute the following line, the query runs EXTREMELY slow and all but locks up the computer:
>>***************
>>SELECT * from Voter WHERE kVoter in (Select kVoter FROM Code WHERE kCodeType="{09D0D53C-3F5A-48B0-8B87-BB740565DA0A}" AND cValue="Y ")
>>***************
>>