Article View: dk.edb.database
Article #15312Re: Hjælp til SQL-streng
From: Jakob Nilsson
Date: Sun, 20 May 2001 12:27
Date: Sun, 20 May 2001 12:27
24 lines
1864 bytes
1864 bytes
"Jonas Delfs" <nospam@delfs.dk> > Det jeg vil t�lle er polt_nr. Men kun r�kker hvor status ikke er 'UA', og > kun een pr. polt_nr. Jeg m� indr�mme jeg ogs� er blevet lidt forvirret over hvad der egentlig skal t�lles :-) Men her er et fors�g: SELECT SUM(Tabel.Antal) FROM (SELECT COUNT (DISTINCT polt_nr) AS Antal FROM order_table WHERE status <> 'UA' GROUP BY kunde_id) Tabel Der der findes i inner-queryen er antallet af unikke polt numre pr. kunde_id, dern�st summeres dette antal i den ydre query. Erstat Tabel og Antal med det du nu synes de skal hedde :-) Mvh. Jakob
Technical Details
Message-ID:
<TION6.22809$zv2.2736835@news010.worldonline.dk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!212.54.64.131!news100.image.dk!news010.worldonline.dk.POSTED!not-for-mailReferences:
<9e1aem$2gg$1@sunsite.dk> <9e1cf8$g3v$1@sunsite.dk> <3B044117.65622DBD@hotmail.com> <9e312m$fc2$1@sunsite.dk> <9e3dfi$oiq$1@sunsite.dk>Show Full Headers
Complete Article Headers
X-Google-Language: DANISH,ASCII X-Google-Thread: fcdf9,493e72e2eaeb395a X-Google-Attributes: gidfcdf9,public X-Google-ArrivalTime: 2001-05-20 05:25:26 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!212.54.64.131!news100.image.dk!news010.worldonline.dk.POSTED!not-for-mail From: "Jakob Nilsson" <jakobnilsson@hotmail.com> Newsgroups: dk.edb.database References: <9e1aem$2gg$1@sunsite.dk> <9e1cf8$g3v$1@sunsite.dk> <3B044117.65622DBD@hotmail.com> <9e312m$fc2$1@sunsite.dk> <9e3dfi$oiq$1@sunsite.dk> Subject: Re: Hjælp til SQL-streng Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <TION6.22809$zv2.2736835@news010.worldonline.dk> Date: Sun, 20 May 2001 14:27:04 +0200 NNTP-Posting-Host: 213.237.11.173 X-Complaints-To: news-abuse@wol.dk X-Trace: news010.worldonline.dk 990361523 213.237.11.173 (Sun, 20 May 2001 14:25:23 MET DST) NNTP-Posting-Date: Sun, 20 May 2001 14:25:23 MET DST Organization: Customer of World Online Denmark A/S