tags:

views:

367

answers:

0

I have a list like listone=[(0,1),(2,45),(0,27),(2,12),(0,45)] which is not stored in mysql database. i want to count similar number of items of the list with comparing mysql table where i store records like the (0,1) item from list is like 0 is one column values1 and 1 is in other column values2 if the both column values are same like (0,1) first entry then are similar urlid | values1 |values2 1 | 0 |1 1 | 2 |45 1 | 0 |95 2 | 2 |21 2 | 0 |23 3 | 1 |12 3 | 3 |15 3 | 1 |19

i want to know how many each urlid's values are similar with listone and then calculate percentage for each urlid like result = 100*(similar values each urlid/total values in each urlids) please write a small command or give examples. thanks