Wednesday, March 7, 2012

Creating one row view help

Hello, I need assistance
I would like to know if it is possible to do the following
Corp Source Category Description_1 Count_1 Cycle
7801 Internal 52 Day Precall Left Message (Answering Machine) 92 A
7801 Internal 52 Day Precall Left Message (Answering Machine) 60 B
7801 Internal 52 Day Precall Not Reported
34 A
7801 Internal 52 Day Precall Not Reported 116 C
7801 Internal 52 Day Precall Left Message (Answering Machine) 26 C
convert it to:
Corp Sourc Category Description_1
Count_1 Cycle
7801 Internal 52 Day Precall Left Message (Answering Machine) 178 A,B,C
7801 Internal 52 Day Precall Not Reported
150 A,C
Trying to say if Corp, Source, Category, Description are the same but have
different cycles I would like to sum the count and just add whatever cycles
in one rowI hope you are having an issue with the string concatenation.
You may want to check out this link
http://omnibuzz-sql.blogspot.com/20...l.blogspot.com/
"Justin" wrote:

> Hello, I need assistance
> I would like to know if it is possible to do the following
> Corp Source Category Description_1 Count_1 Cycle
> 7801 Internal 52 Day Precall Left Message (Answering Machine) 92 A
> 7801 Internal 52 Day Precall Left Message (Answering Machine) 60 B
> 7801 Internal 52 Day Precall Not Reported
> 34 A
> 7801 Internal 52 Day Precall Not Reported 116 C
> 7801 Internal 52 Day Precall Left Message (Answering Machine) 26 C
> convert it to:
> Corp Sourc Category Description_1
> Count_1 Cycle
> 7801 Internal 52 Day Precall Left Message (Answering Machine) 178 A,B,
C
> 7801 Internal 52 Day Precall Not Reported
> 150 A,C
>
> Trying to say if Corp, Source, Category, Description are the same but have
> different cycles I would like to sum the count and just add whatever cycle
s
> in one row
>
>|||How about :
SELECT Corp, Source, Category, Description_1,
SUM(Count_1) as Count_1,
MIN(Cycle) as Cycle
FROM Whatever
GROUP BY Corp, Source, Category, Description
Roy Harvey
Beacon Falls, CT
On Tue, 13 Jun 2006 06:34:02 -0700, Justin
<Justin@.discussions.microsoft.com> wrote:

>Hello, I need assistance
>I would like to know if it is possible to do the following
>Corp Source Category Description_1 Count_1 Cycle
>7801 Internal 52 Day Precall Left Message (Answering Machine) 92 A
>7801 Internal 52 Day Precall Left Message (Answering Machine) 60 B
>7801 Internal 52 Day Precall Not Reported
>34 A
>7801 Internal 52 Day Precall Not Reported 116 C
>7801 Internal 52 Day Precall Left Message (Answering Machine) 26 C
>convert it to:
>Corp Sourc Category Description_1
> Count_1 Cycle
>7801 Internal 52 Day Precall Left Message (Answering Machine) 178 A,B,C
>7801 Internal 52 Day Precall Not Reported
>150 A,C
>
>Trying to say if Corp, Source, Category, Description are the same but have
>different cycles I would like to sum the count and just add whatever cycles
>in one row

No comments:

Post a Comment