Rohita Khatiwada Rohita Khatiwada - 4 months ago 18
Python Question

counting rows returned in postgresql

I need to count the number of rows returned from database.By using following code

rv = plpy.execute("SELECT * FROM AA where name = 'active '")
rv[0]["id"]


works when some values are returned but I need to check if no values are returned: Can someone help please.

Answer