Forums

This topic is locked

:( Moving Grouped Rows to New Columns

Posted 14 Jun 2007 17:54:23
1
has voted
14 Jun 2007 17:54:23 Greg Meyer posted:
Hey Everyone. I'm fairly new to SQL and brand new to this forum.

I have a shopping center database I'm organizing in Access and I'm trying to do it all using SQL code instead of crap-ass design view. Anyway, here's where I'm stumped.


centerid store sqft category
4545 Sears 174000 Department stores
4545 Crate&B 16000 Home decor/lamps/drapes
4545 JCPenney 152000 Department stores
5151 Sears 159000 Department stores
5151 Borders 23000 Book stores
5151 Big Kmart 104231 Discount stores
5555 JCPenney 146000 Department stores
5555 Borders 31000 Book stores
5555 Macy's 124000 Department stores
5125 Sears 152000 Department stores
5125 Belk Department stores
5125 Nordstrom 121000 Department stores

As you can see, the stores are categorized by shopping center (the 'centerid'). What I need is to move all the stores with the same centerid to be on one line and sorted in descending order from left to right Like this:


centerid store sqft category store2 sqft2 category2 . . .
4545 Sears 174000 Department stores Crate&B 16000 Home Decor...

Any ideas?

thanks in advance,
Greg

Reply to this topic