0
dintinct query
i have a table which have the atributes city and cityid ..table shown below:- id city 1 surat 1 kota 2 kota 3 bhopal 5 bhopal 4 rajkot in the above table i want in the resultant output in this form that where the name of the city and id is same then the output will shown the distinct value
1 Odpowiedź
0
I don't know if I get the question, but I will try ...
>>>> a = {1 :"surat", 2:"kota",3:"kota",4:"bhopal",5:"bhopal",4:"raijkot"}
>>>> for i in a;
>>>> print(i,a[i])
1 surat
2 kota
3 kota
4 raijkot
5 bhopal
Well, I don't know if is this that you asked for. Dictonaries can't have the same keys (the two '1'), so there is something to adjust... if you explain me better what you need, I will try to help you.