Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'example:': 0.03; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'clause.': 0.16; 'distinct': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sqlite3': 0.16; 'subject:request': 0.17; 'feb': 0.19; '+0000': 0.20; 'select': 0.26; 'functions.': 0.27; 'header:X-Complaints-To:1': 0.28; 'returned': 0.30; 'club': 0.33; 'url:home': 0.33; 'to:addr:python- list': 0.33; 'done': 0.34; 'received:org': 0.36; 'charset:us- ascii': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'limit': 0.65; 'hints': 0.65; 'home': 0.66; 'union': 0.66; '2013': 0.84; 'dennis': 0.91; 'received:108': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Improve reduce functions of SQLite3 request Date: Sun, 03 Feb 2013 13:11:30 -0500 Organization: > Bestiaria Support Staff < References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-216-248.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359915110 news.xs4all.nl 6985 [2001:888:2000:d::a6]:47155 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38110 On Sun, 3 Feb 2013 09:46:08 +0000 (UTC), Steffen Mutter declaimed the following in gmane.comp.python.general: > EXAMPLE: > SELECT homenr as nr, home as club FROM Runde20122013 WHERE > place="karlsruhe" UNION SELECT guestnr as nr, guest as club FROM > 20122013 WHERE place="karlsruhe" GROUP BY nr LIMIT 10 > > the nr needs to be unique together with the shortest clubname returned > by the where clause. > > Any hints how to get this done either with SQLite3 tecneeqs or python > functions. > Untested: SELECT DISTINCT * from (select homenr as nr, home as club FROM Runde20122013 WHERE place="karlsruhe" UNION SELECT guestnr as nr, guest as club FROM 20122013 WHERE place="karlsruhe") limit 10 -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/