Du bist hier: Snippet-Verzeichnis » Datenbanken (26)
Sprache:

Count of Distinct fields in a table

Sprache: English
Programmiersprache: SQL
Veröffentlicht von: wapu [nicht registriert]
Letzte Änderung: 15.05.2006
Aufrufe: 1293


Beschreibung

This is goodfor getting a count of the instances of a value in a table. eg. How many Addresses in the table are from each state?

Code

1 /*This will get a count of all the instances of a state in the table*/ 2 select stateField, count(*) as Total 3 from AddressTable 4 group by stateField

Noch kein Kommentar vorhanden

Dieses Snippet kommentieren

Name *  

E-Mail (wird nicht angezeigt) *    

Website  

Kommentar *  

Sicherheitscode Sicherheitscode *    

RSS