to get "one summary row per category"
Group by category and use sum() or any other function as required
[quoted text, click to view] "+Bob+" wrote:
> I have a table that contains records in various categories. Let's call
> the possible categories A, B, C, D, E, etc. I need to pull just a list
> of the categories that are in the table.
>
> On a particular day there may be hundreds of records but only in
> categories A, D, and E. I don't want all the records, I just need a
> list of categories. So, on this particular day, I should get three
> records (rows) back.
>
> How do I write an SQL statement that says "just give me one summary
> row per category" ?
>
>
I have a table that contains records in various categories. Let's call
the possible categories A, B, C, D, E, etc. I need to pull just a list
of the categories that are in the table.
On a particular day there may be hundreds of records but only in
categories A, D, and E. I don't want all the records, I just need a
list of categories. So, on this particular day, I should get three
records (rows) back.
How do I write an SQL statement that says "just give me one summary
row per category" ?
Bob
You need GROPUP BY day(datecolumn)
[quoted text, click to view] "+Bob+" <uctraing@ultranet.com> wrote in message
news:94l2l29ip4fh5l17olocag06vf5hrpl483@4ax.com...
>I have a table that contains records in various categories. Let's call
> the possible categories A, B, C, D, E, etc. I need to pull just a list
> of the categories that are in the table.
>
> On a particular day there may be hundreds of records but only in
> categories A, D, and E. I don't want all the records, I just need a
> list of categories. So, on this particular day, I should get three
> records (rows) back.
>
> How do I write an SQL statement that says "just give me one summary
> row per category" ?
>
>