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 |
|
ofsouto
Starting Member
22 Posts |
Posted - 2005-01-26 : 13:47:35
|
| Hi, dearI have 2 tables: tbClassified, tbNotClassified.CREATE TABLE [dbo].[ tbClassified] ( [Suplier_Code] [char] (8), [Ref_date] [smalldatetime] NOT NULL , [Risc_Type] [char] (1), [Client_Code] [char] (8), [Risc_level] [char] (4),) ON [PRIMARY]GOALTER TABLE [dbo].[ tbClassified] ADD CONSTRAINT [PK_TBCLASSIFIED] PRIMARY KEY NONCLUSTERED ( [Suplier_Code], [Ref_date], [Risc_Type] ) GOCREATE TABLE [dbo].[ tbNotClassified] ( [Suplier_Code] [char] (8), [Ref_date] [smalldatetime] NOT NULL , [Risc_Type] [char] (1), [Client_Code] [char] (8), [Risc_level] [char] (4),) ON [PRIMARY]GOALTER TABLE [dbo].[ tbClassified] ADD CONSTRAINT [PK_TBNOTCLASSIFIED] PRIMARY KEY NONCLUSTERED ( [Suplier_Code], [Ref_date], [Risc_Type] ) GOThese tables are differents but I just list the common attributes.I need to show the level evolution of each client during the last 13 months (Now and the last 12 months). I intend to create a grid as showed bellow:Months Jan/2005 Dec/2004 ... Mar/2004 Feb/2004 Jan/2004Clients00001 01 02 05 06 0700002 NC NC NC NC NC00003 05 05 05 05 05... 00008 NC 01 06 04 NC00009 07 06 03 02 0100010 NC NC 01 01 NCWhat's the best and fastest way to create a Stored Procedure to list this grid? Temporary Tables? Cursors?Thank you very muchObedeBrazil |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
|
|
|
|
|