For example I have my dictionary: my_dict = {'2':'even','1':'odd','3':'odd'}
And this is my database:
+---------+--------+
| Numeric | String |
+---------+--------+
| 5 | five |
| 4 | four |
| 3 | three |
| 2 | two |
| 1 | one |
+---------+--------+
In my_dict
dictionary,using their keys
, I want to get their String
value in my database (SQL SERVER) and using their values
, sort their String
value in this sequence:
odd - even - odd
to be liked this
one two three
.
And print the output like this: Let's count one two three
. Actually I just based from Jisoo's question Querying a list of tuples in Database coz we're quite similar but in mine, is about dictionary.