Announcement

Collapse
No announcement yet.

group, count

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • group, count

    Hallo,
    ich habe eine Tabelle etwa so:
    werta wertb
    10 15
    10 30
    11 30
    11 31
    11 38

    Select count(*) from table group by werta
    lieft für jeden wert die anzahl also:
    10 2
    11 3
    ich möchte aber dass die anzahl der results gezählt wird also das ergbnis 2.
    Irgendwie steh ich grade auf dem schlauch. Wie bekomm ich das hin?

  • #2
    Bin mir jetzt nicht sicher, ob ich das richtig verstanden habe, aber meinst du etwa dieses:
    select count(*) from (select distinct werta from tabelle) as X

    bye,
    Helmut

    Comment


    • #3
      Huch.

      Das "as X" hat mir gefehlt

      Comment

      Working...
      X