"Grouping" database rows in ASP
Is there any way to do this? Follow this link to my site...
http://www.rewardslookup.com/EarnSearch.asp?search=toys&srchtype=ANY
...and you will see that there are several rows for those merchants who offer rewards in multiple places. What I'd like to do is have the first two columns span the multiple rows for those merchants. I manually edited the output of the page above to show what I want to do:
http://www.rewardslookup.com/EarnSearchGroup.html
I'm guessing it's impossible because of the need to use the "rowspan" field in the tag, and then eliminate those cells from the following rows. Also there's the complication of paging, and what happens when a multiple-row group spans the page break.
But I thought it was worth asking about anyway, because "you never know"... It's kind of annoying to have merchant data repeated so many times -- especially the long descriptions.
Thanks,
Kristen
------------------
http://www.RewardsLookup.com
[This message has been edited by KLWong (edited 16 June 2000).]
Kristen
http://www.RewardsLookup.com and
http://www.cancerdrugfeedback.net still under early development
Personal page:http://www.isd.net/kwong/kristen.html
KLWong posted this at 17:58 — 19th June 2000.
They have: 135 posts
Joined: Apr 2000
Well, no thanks to anyone here, I figured it out myself . Thought I'd post what I did just in case someone else out there was waiting for an answer, too.
It wasn't the simple "GROUP BY" SQL clause that I'd hoped would work: I turned out to need another column indicating how many programs are present for each merchant. Then it became a "brute force" thing, looping through all the records one at a time. When it's the first row for a given merchant, I add a rowspan=MerchRecCount field to the first two column <td> tags; in all other rows for that merchant the first two column cells are omitted. There is a slight complication due to the paging of results (showing 20 at a time). But since I am already keeping track of the fact that "this is row n of MerchRecCount", it's easy to adjust the rowspan number accordingly for the first displayed row.
The working results (as of today while I complete my testing) are on my site on the page at
http://www.RewardsLookup.com/EarnSearch2.asp
By tomorrow I should have moved it over to the main search URL mentioned in the first message of this thread.
------------------
http://www.RewardsLookup.com
Kristen
http://www.RewardsLookup.com and
http://www.cancerdrugfeedback.net still under early development
Personal page:http://www.isd.net/kwong/kristen.html
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.