[melbourne-pug] Question about adding members to list : hypothetical just for interest kind of question

Josh Bode joshbode at gmail.com
Fri Feb 21 01:40:07 CET 2014


If the data you need to collapse is being duplicated across multiple rows
due to distinct values in other columns, you could generate that data in a
separate, more focussed query. That way you would avoid having to
de-duplicate that information, but you do have an additional query to
maintain and fetch data from, though. At the data volumes you're talking
about this might not be an issue, but for larger data-sets this would be
more efficient.


On 21 February 2014 11:30, David Crisp <dcrisp at netspace.net.au> wrote:

> Ahh :)    I also meant to say that whilest the particular fields I am
> talking about in this question are the same,  data at the end of those rows
> is different,  and will be treated differently.
>
> I really abstracted my query away from what I am actually trying to do
> exactly and more along the lines of how effiecient or ineficient I am doing
> things.
>
> This particular SQL query was originally - before I optimised it for the
> person here working with it - returning upwards of 100,000 rows of data
> because it had been produced by sombody using the built in data join wizard
> in MSSQL Server Management Studio.  They would then post process it in code
> (various flavours of .net and C ) and come up with the results they were
> wanting...  The query I hand cut for them and tested now returns exactly
> the data they wish in just enough rows to contain it all.  No need to post
> process it as such.
>
> Regards,
> David
>
>
>
>
> On Fri, 21 Feb 2014, Ben Finney wrote:
>
>  David Crisp <dcrisp at netspace.net.au> writes:
>>
>>  In this case I am reading in data from a SQL database query(pymssql)
>>>
>>
>> If you want to eliminate duplicates from your query, do so with ‘SELECT
>> DISTINCT’. Then you don't ever get the duplicate rows in the first place
>> :-)
>>
>> --
>> \          “Ocean, n. A body of water occupying about two-thirds of a |
>>  `\     world made for man — who has no gills.” —Ambrose Bierce, _The |
>> _o__)                                        Devil's Dictionary_, 1906 |
>> Ben Finney
>>
>> _______________________________________________
>> melbourne-pug mailing list
>> melbourne-pug at python.org
>> https://mail.python.org/mailman/listinfo/melbourne-pug
>>
> _______________________________________________
> melbourne-pug mailing list
> melbourne-pug at python.org
> https://mail.python.org/mailman/listinfo/melbourne-pug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/melbourne-pug/attachments/20140221/71912803/attachment-0001.html>


More information about the melbourne-pug mailing list