Subject | order by with grouping? |
---|---|
Author | bwc3068 |
Post date | 2013-01-24T22:40:13Z |
hi--
always a great place to get help!!
here's what i have data wise:
Tag ID Date
ABC 11 2012
DEF 11 2011
GHJ 11 2010
HHH 22 2012
ZZZ 22 2011
AAA 22 2010
AAK 33 2012
AAD 44 2012
YYY 44 2010
IF i select * order by tag, date
i get
AAA 22
AAD 44
AAK 33
ABC 11
DEF 11
GHJ 11
HHH 22
YYY 44
ZZZ 22
My desire is to still keep the "groups" of ID together
i'd LIKE
AAA 22
HHH 22
ZZZ 22
AAD 44
YYY 44
AAK 33
ABC 11
DEF 11
GHJ 11
but
select * order by tag, date group by ID
doesn't work
NOTE i do NOT want to sort by ID. I just want the list sorted by Tag, subsorted by date. BUT I want all the IDs together because the Tag might change from date to date for ID
any thoughts or hints?
thanks
kelly
always a great place to get help!!
here's what i have data wise:
Tag ID Date
ABC 11 2012
DEF 11 2011
GHJ 11 2010
HHH 22 2012
ZZZ 22 2011
AAA 22 2010
AAK 33 2012
AAD 44 2012
YYY 44 2010
IF i select * order by tag, date
i get
AAA 22
AAD 44
AAK 33
ABC 11
DEF 11
GHJ 11
HHH 22
YYY 44
ZZZ 22
My desire is to still keep the "groups" of ID together
i'd LIKE
AAA 22
HHH 22
ZZZ 22
AAD 44
YYY 44
AAK 33
ABC 11
DEF 11
GHJ 11
but
select * order by tag, date group by ID
doesn't work
NOTE i do NOT want to sort by ID. I just want the list sorted by Tag, subsorted by date. BUT I want all the IDs together because the Tag might change from date to date for ID
any thoughts or hints?
thanks
kelly