I have following query cur.execute("SELECT COUNT(addr) FROM list_table WHERE addr = '192.168.1.1'")
to count the number of times the same address (192.168.1.1) appears on list_table
table. addr
is of inet type.
When I assign the query to a variable and print its result I get None
:
res = cur.execute("SELECT COUNT(addr) FROM list_table WHERE addr = '192.168.1.1'")
print res # None
What is the proper way to get such thing?