1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

SQL and Stored Procedures

Discussion in 'Software Development' started by jaldrich, Jun 17, 2002.

Thread Status:
Not open for further replies.
  1. jaldrich

    jaldrich Thread Starter

    Mar 23, 2002
    I am using SQL on an enterprise database/server and feeding the data back to a client browser using html and asp.

    I need to create a sub procedure that totals the values in a colume Sum(values) as Total. I also need get a distinct Employer name so it only shows once and I need to know how many rows from the table were used to acquire this data.

    I can get the count keyword function to work or aI can get the sum keyword function to work. Both have worked with the select distinct employer from ....

    How do I get them to work all together?
  2. TimCottee


    Oct 10, 2001
    Something like this:

    Select Employer, Sum(Values) As Total, Count(Employer) As NumberOfRecords From MyTable Group By Employer
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/83820

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice