Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 17th, 2004, 03:45 AM
Registered User
 
Join Date: Nov 2003
Location: , , Austria.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Berni016x
Default Crosstab query

How to write a crosstab query?
i got one at access2000 but this doesn't work at sql server 2000

can anybody help me please?

it is like the following.
a table named SUBSCRIBERS
a table named INTERESTS
a table named SUBSCRIBERS_INTERESTS.

The query does the following:
IDSubscriber [IDOFINTEREST1] [IDOFINTEREST2] [IDOFINTEREST3] [....]
1 0 1 1
2 1 0 0
3 1 1 1

explanation: the subscriber with the id = 1 has got the interest with the id=2 and the interest with the id=3

each datarows of the INTERESTS-Table is a column at the query.

please help!

thx

Reply With Quote
  #2 (permalink)  
Old September 17th, 2004, 09:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

This article shows the basic ways of generating a crosstab in SQL Server. http://support.microsoft.com/default.aspx?kbid=175574#3
Reply With Quote
  #3 (permalink)  
Old September 17th, 2004, 10:43 AM
Registered User
 
Join Date: Nov 2003
Location: , , Austria.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Berni016x
Default

Thank you for reply!
Sorry, this article can't help me, because the columns are dynamic!
so each column is a entry at the of the other table.

this is a resolution of a m:n relationship!

this is the reasion, why i wrote [...] at the example.

thx
Bernhard

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crosstab query and parameter stoneman Access 10 January 6th, 2006 04:45 PM
crosstab query and asp tulincim Classic ASP Databases 0 September 13th, 2005 03:00 PM
Crosstab query with no results edubbelaar Access 0 November 22nd, 2004 06:12 AM
Crosstab Query Ben Access 7 November 22nd, 2004 06:08 AM
Crosstab query vladimir Access 1 December 1st, 2003 04:02 PM



All times are GMT -4. The time now is 12:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.