[Tutor] FW: query

Alan Gauld alan.gauld at btinternet.com
Tue Jun 23 20:01:58 CEST 2015


On 23/06/15 18:13, Gupta, Manaswini Kat wrote:

> I need to fetch the records of count(*)>3 can you please tell me the logic in python

Sorry, but that's not very clear.
What do you mean?

It looks like a bit of SQL so, are you asking how to execute
that SQL from within Python? If so on what database?

Or are you trying to convert SQL logic into pure Python code?
If so that depends on how you are storing your records.
Are they in a list, a dictionary, a flat file?

Also count(*)>3 is a boolean expression so it will
return True or False and no records.
What do you mean by fetching the records?
Which records?

You probably need to show us an example of your data and
the results you want. Maybe show us the full SQL query
you are trying to execute or emulate.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list