Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   [Anfägerfrage] wofür ist Group By gut? (https://www.delphipraxis.net/138231-%5Banfaegerfrage%5D-wofuer-ist-group-gut.html)

alzaimar 6. Aug 2009 11:42

Re: [Anfägerfrage] wofür ist Group By gut?
 
Stimmt. Hab zwar noch nie verwendet, aber ich könnte. :stupid:

p80286 6. Aug 2009 12:32

Re: [Anfägerfrage] wofür ist Group By gut?
 
Zitat:

Zitat von Blup
Die Feldliste im Select muss nicht alle Felder aus dem GroupBy enthalten.
Ob das sinnvoll ist, ist eine andere Frage.

Äh warum? Wodurch ist das begründet?
SQL-Code:
select 'dummy',substr(coddos,1,1),count(idedos)
from tabdos
group by substr(coddos,1,1)
das funktioniert, aber wohl nur wenn es sich um eine Konstante ('dummy') handelt!?

Hier gibt's Mecker:
SQL-Code:
select substr(coddos,1,1),count(idedos)
from tabdos
where substr(coddos,1,1)='H'
Gruß
K-H

Blup 7. Aug 2009 07:12

Re: [Anfägerfrage] wofür ist Group By gut?
 
Zitat:

Zitat von p80286
Zitat:

Zitat von Blup
Die Feldliste im Select muss nicht alle Felder aus dem GroupBy enthalten.
Ob das sinnvoll ist, ist eine andere Frage.

Äh warum? Wodurch ist das begründet?

Wie begründet?

SQL-Code:
select  a
from    tabelle
group by a, b, c
Zitat:

Zitat von p80286
Hier gibt's Mecker:
SQL-Code:
select substr(coddos,1,1),count(idedos)
from tabdos
where substr(coddos,1,1)='H'

:gruebel: Gehts hier nicht um group by?


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:36 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz