• I know this,

    But I forgot to tell you that my query return values for more than one condition.

    I mean: the query returns records for more than one person, and I want to count each persons' records in separate.

    The @@ROWCOUNT counts all returned records.

    the following is my query for 2 persons where I want to count the records returned for each:

    select distinct OO.ORDER_NUMBER, COUNT((select distinct OO.ORDER_NUMBER )) from Table as OO

    WHERE (OO.SUBMITTED_DATE BETWEEN '20090101' AND '20091231') AND (OO.TICKET_NUMBER IS NOT NULL) and OO.NIN_CODE='990685711' or OO.NIN_CODE='993435940'

    group by OO.ORDER_NUMBER

    note: The two persons are represented by OO.NIN_CODE

    and so, I want to count each persons records, and this is also a sample for a huge number of persons where I want to count each person data in the previous condition