Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Grouping non-aggregate data

HELP!
I'm trying to display the following fields grouping on the id

select issueid,issuetxt,issuedate from tblworklog
group by issueid

I know that group by cannot be used unless included with aggregate data but
there must be some way to get the output described above, I just don't know
what it is.

I've created this report in vb that requires the data to be grouped in the
view that it's based on in order to display it in groups, can someone please
help??
[528 byte] By [sheryl kemp] at [2007-11-9 21:10:48]
# 1 Re: Grouping non-aggregate data
what RDBMS ?

"sheryl kemp" <dianedinero@aol.com> wrote in message
news:3dd926f7$1@tnews.web.dev-archive.com...
>
> HELP!
> I'm trying to display the following fields grouping on the id
>
> select issueid,issuetxt,issuedate from tblworklog
> group by issueid
>
>
> I know that group by cannot be used unless included with aggregate data
but
> there must be some way to get the output described above, I just don't
know
> what it is.
>
> I've created this report in vb that requires the data to be grouped in the
> view that it's based on in order to display it in groups, can someone
please
> help??
>
David Satz at 2007-11-11 23:52:19 >
# 2 Re: Grouping non-aggregate data
"David Satz" <davidNOSPAMsatz@yahoo.NOSPAM.com> wrote:

RDBMS is SQL SERVER 2000

>what RDBMS ?
>
>"sheryl kemp" <dianedinero@aol.com> wrote in message
>news:3dd926f7$1@tnews.web.dev-archive.com...
>>
>> HELP!
>> I'm trying to display the following fields grouping on the id
>>
>> select issueid,issuetxt,issuedate from tblworklog
>> group by issueid
>>
>>
>> I know that group by cannot be used unless included with aggregate data
>but
>> there must be some way to get the output described above, I just don't
>know
>> what it is.
>>
>> I've created this report in vb that requires the data to be grouped in
the
>> view that it's based on in order to display it in groups, can someone
>please
>> help??
>>
>
>
sheryl kemp at 2007-11-11 23:53:24 >
# 3 Re: Grouping non-aggregate data
"sheryl kemp" <dianedinero@aol.com> wrote:
>
>"David Satz" <davidNOSPAMsatz@yahoo.NOSPAM.com> wrote:
>
>RDBMS is SQL SERVER 2000
>
>
>
>>what RDBMS ?
>>
>>"sheryl kemp" <dianedinero@aol.com> wrote in message
>>news:3dd926f7$1@tnews.web.dev-archive.com...
>>>
>>> HELP!
>>> I'm trying to display the following fields grouping on the id
>>>
>>> select issueid,issuetxt,issuedate from tblworklog
>>> group by issueid
>>>
>>>
>>> I know that group by cannot be used unless included with aggregate data
>>but
>>> there must be some way to get the output described above, I just don't
>>know
>>> what it is.
>>>
>>> I've created this report in vb that requires the data to be grouped in
>the
>>> view that it's based on in order to display it in groups, can someone
>>please
>>> help??
>>>
>>
>>
>
SELECT issueid, issuetxt, issuedate
FROM tblworklog
GROUP BY issueid, Issuetxt, issuedate

OR

SELECT issueid, Min(issuetxt), Min(issuedate)
FROM tblworklog
GROUP BY issueid
OR

SELECT issueid, Max(issuetxt), Max(issuedate)
FROM tblworklog
GROUP BY issueid
Q*bert76 at 2007-11-11 23:54:19 >
# 4 Re: Grouping non-aggregate data
Sheryl, rather than using Group By you might want to look at using the DISTINCT
operator

SELECT DISTINCT issueid,issuetxt,issuedate FROM tblworklog

will eliminate duplicate rows.

...joe

"sheryl kemp" <dianedinero@aol.com> wrote:
>
>HELP!
>I'm trying to display the following fields grouping on the id
>
>select issueid,issuetxt,issuedate from tblworklog
>group by issueid
>
>
>I know that group by cannot be used unless included with aggregate data
but
>there must be some way to get the output described above, I just don't know
>what it is.
>
>I've created this report in vb that requires the data to be grouped in the
>view that it's based on in order to display it in groups, can someone please
>help??
>
Joe Maki at 2007-11-11 23:55:19 >