Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102325
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Cannot step through asynchronous iterator manually |
| Date | 2016-01-31 11:50 +1300 |
| Message-ID | <dh4t2iFjpnrU1@mid.individual.net> (permalink) |
| References | (2 earlier) <n8hrs1$orn$1@ger.gmane.org> <56AD122F.2030904@gmail.com> <CAPTjJmpGFbnOJGTQcYcFQK83HGCoH5td57J7+RpM_tsR=O3ZOA@mail.gmail.com> <56AD31E7.50407@gmail.com> <mailman.142.1454191515.2338.python-list@python.org> |
Michael Torrie wrote: > I'm not sure how SQLite handles it, or even what the SQL spec says, but > I know in MySQL you could do something like this: > > SELECT count(id) as row_count,`tablename`.* FROM `tablename` WHERE condition I don't think that's strictly valid SQL. I know of at least one SQL implementation that complains if you have fields in an aggregate query that aren't either in an aggregate function or listed in the GROUP BY clause. To make it valid you would have to wrap LAST() around all of the other fields. (Probably individually -- I doubt whether LAST(tablename.*) would be accepted.) Which seems like a lot of trouble to go to just to tell whether you have a unique result. Also it's asking the DB to perform more work than you really need. It has to run the whole query before returning any results, whereas doing it yourself you can give up after reading the second result if there is one. -- Greg
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Cannot step through asynchronous iterator manually Michael Torrie <torriem@gmail.com> - 2016-01-30 15:05 -0700 Re: Cannot step through asynchronous iterator manually Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-01-31 11:50 +1300
csiph-web