Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jbphoenix
Yak Posting Veteran
68 Posts |
Posted - 2011-07-14 : 14:29:25
|
| Basically I'm trying to query a table and only produce 1 row per acctno. Here is what my table looks like.Port acctno mod modmnth status mnth NoMnthsNorth 5174 Ext 200708 0 200708 0North 5174 Ext 200708 15 200709 1North 5174 Ext 200708 30 200710 2North 5174 Ext 200708 15 200711 3North 5174 Ext 200708 30 200712 4North 5174 Ext 200708 0 200801 5I would like to have the query to return the port, acctno, mod, modmnth, NoMnths, and status. I need to have the number of months as a column. The data returned should look like thisPort acctno mod modmnth 0 1 2 3 4 5North 5174 Ext 200708 0 15 30 15 30 0 I tried using pivot I couldn't get it work.Thanks |
|
|
|
|
|