Results 1 to 3 of 3

Thread: novice to sql

  1. #1
    Join Date
    Sep 2003
    Location
    Richmond, CA
    Posts
    11

    Question Unanswered: novice to sql

    I have a report that has a listing of all clients with a logical value of true. I am trying to place a number at the end of the report that represents the total number of clients with this value. I cannot remember which expression it is either a 'count' or 'sum' expression.

    please help

    Stu

    New to Sybase

  2. #2
    Join Date
    Sep 2004
    Location
    Stockholm, Sweden
    Posts
    28
    What do you mean by report? Not sure if I understand what you mean but do you want to count the numer of tuples with a certain value?

    select count(*) from
    tablename
    where
    field = value

    of cource, if the field you have in mind is an integer and you use 0 and 1 as values you can also sum the tuples (but use the first expression, it has a clearer semantic meaning).

    select sum(field)
    tablename
    where
    field = value

    this is _very_ basic so if misunderstood you, please be more specific.

  3. #3
    Join Date
    Sep 2003
    Location
    Richmond, CA
    Posts
    11

    New to Sybase

    Thanks,

    this helped immensely

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •