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??
# 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??
>
# 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??
>>
>
>
# 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
# 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??
>