How to count all the rows that meet a condition (Enterprise Manager)

To count all the rows that meet a condition

  1. Start the query by adding the table you want to summarize to the Diagram pane.
  2. Right-click anywhere in the Diagram, Grid, or SQL panes, and choose Group By. The Query Designer adds a Group By column to the grid in the Grid pane.
  3. Check * (All Columns) in the input source window for the table.

    The Query Designer automatically fills the term Count into the Group By column in the Grid pane and assigns a column alias to the column you are summarizing to create a useful column heading in query output. For more details, see Creating Column Aliases.

  4. Add the data column that you want to search, and then clear the check box in the Output column.

    The Query Designer automatically fills the term Group By into the Group By column of the grid.

  5. Change Group By in the Group By column to Where.
  6. In the Criteria column for the data column to search, enter the search condition.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.