Marco: Mysql

Hallo alle zusammen!
Kann ich folgendes in eine Mysql-Abfrage packen:
Select count(*) as count from table where feld=0
Select count(*) as count2 from table where feld=1

Marco

  1. Moin Moin !

    select feld,count(*) from ... group by feld

    könnte funktionieren. Details findest Du in der MySQL-Doku.

    Alexander

    --
    Nein, ich beantworte keine Fragen per eMail. Dafür ist das Forum da.
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so!"
  2. Halihallo Marco

    Kann ich folgendes in eine Mysql-Abfrage packen:
    Select count(*) as count from table where feld=0
    Select count(*) as count2 from table where feld=1

    Ja:

    SELECT COUNT(*) AS count, feld FROM table GROUP BY feld HAVING feld=0 OR feld=1

    Viele Grüsse

    Philipp

    1. Hallo Philipp,
      hat geklappt.

      Vielen Dank, im Mysql-Manual zu suchen, war mir etwas zu viel.

      Marco