Friday, June 7, 2013

[SQL Server] slowly changing dimension?

[SQL Server] slowly changing dimension?


slowly changing dimension?

Posted: 07 Jun 2013 06:04 AM PDT

Hi everyone.I've got to figure out whose games scores changed the least over time. I've created DDL to illustrate[code="plain"]create table gamescores(gameNo varchar(20) not null,player varchar (20) not null,score int not null,datePlayed datetime not null,memo varchar(20) null,)insert into gamescoresvalues('Game1', 'P1', 50, getdate()-2, NULL), ('Game1', 'P2', 60, getdate()-2, NULL),('Game1', 'P3', 70, getdate()-2, NULL),('Game2', 'P1', 50, getdate()-1, NULL),('Game2', 'P2', 65, getdate()-1, NULL),('Game2', 'P3', 76, getdate()-1, NULL),('Game3', 'P1', 50, getdate(), NULL),('Game3', 'P2', 70, getdate(), NULL),('Game3', 'P3', 81, getdate(), NULL);[/code]as you can see, player 1's scores don't change. I want to write a query to capture in my bigger table, the player with No change to game scores, over a period of any 3 days. Can you show me how? Thanks.

dynamic joins

Posted: 06 Jun 2013 09:25 PM PDT

Hi ,What would be the best way to dynamically self join a table to create the example contained with the excel spreadsheet?The number of rules can vary depending on the order. Is there a way of creating a script/function that will look at all rules applied to a order and create 1 line per order with all rules applied?all suggestions would be welcomeThanks in advanceDan

No comments:

Post a Comment

Search This Blog