Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid key lenght
Message
From
25/02/1997 14:27:50
 
 
To
25/02/1997 14:20:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00021912
Message ID:
00021995
Views:
34
>I'm assuming that you are looking for different records with the same address1 AND address2.
>
>Try
>SELECT ADDRESS1,ADDRESS2,COUNT(*) ;
> from DONOR;
> group by ADDRESS1,ADDRESS2;
> order by 3 DESC;
> into cursor temp
>
>This will give you all the Address1's and Address2's and their respective counts in the DONOR table. The order by just makes it easier to look at what kind of numbers you have.
>
>Perhaps I'm not quite understanding what you are trying to do, but your second query is really not needed. You have your duplicate addresses and how many duplicates of each pair in the cursor temp.
>
>
>>I get the error 'Invalid key length' when :
>>
>>select a.ADDRESS1,a.ADDRESS2 from DONOR a group by a.ADDRESS1,a.ADDRESS2 having count(*)>1 into cursor temp
>>
>>select a.ADDRESS1 as ADDRESS1 from DONOR a ,temp b where a.ADDRESS1=b.ADDRESS1 and a.ADDRESS2=b.ADDRESS2 order by a.ADDRESS1,a.ADDRESS2 into cursor result
>>
>>I attemp to find out record with duplicate value of address1 and address2.
>>The error locate at the second select statment.
>>I have try
>>- reindex the donor table
>>- add 'where .t.' at the first select statement
>>but still get the error. Why?
>>
>>Info: Address1 and Address2 are character fields of length 50.
>>
>>Thanks
>>-Jasper

I need the second Select, because I need to list out the duplicated record one by one to the user.
oh, what is the fastest way to write good program?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform