Monday, April 23, 2012

How to Find Duplicate Values in Arrays?

I am working on SQLlite and I have written a query which Returns me Two Array.<br/>
ItemsArray and CustomersIDArray as
<pre>
ItemsArray
Element at Index 0 = Off White,
Element at Index 1 = Fan,
Element at Index 2 = Off White,
Element at Index 3 = Delux,
Element at Index 4 = Fan
CustomerIDArray
Element at Index 0 = 1,
Element at Index 1 = 2,
Element at Index 2 = 2,
Element at Index 3 = 3,
Element at Index 4 = 4
</pre>
I want Result like that off White = 2 (count) , Fan = 2 (count) and Delux = 1;
and the Resultant Array,
<pre>
Result Array
Element at Index 0 = Off White,
Element at Index 1 = Fan,
Element at Index 3 = Delux <br/>
</pre>


Actually I want the count of repetition in first array but the value must not same for CustomerArray.
Please Help me through Logic or Code





No comments:

Post a Comment