Thread esskar in der SQL welt (27 answers)
Opened by esskar at 2006-09-26 10:47

esskar
 2006-09-28 12:41
#34713 #34713
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
okay, noch eine Frage - keine Ahnung, ob ich das schon von SQL server lösen lassen kann.

ich hab folgende tabelle
|---------------------------------------------------|
| Start               | End                 | Count |
|---------------------------------------------------|
| 2006-09-19 00:00:00 | 2006-09-19 01:00:00 |     1 |
| 2006-09-19 00:00:00 | 2006-09-19 02:00:00 |     8 |
| 2006-09-19 00:00:00 | 2006-09-19 03:00:00 |    19 |
| 2006-09-19 00:00:00 | 2006-09-19 04:00:00 |    49 |
| 2006-09-19 00:00:00 | 2006-09-19 05:00:00 |   110 |
| 2006-09-19 00:00:00 | 2006-09-19 06:00:00 |   212 |
|---------------------------------------------------|


so, count bezieht sich also immer auf den ganzen zeitraum.
ich hätt jetzt gern die differenz zum vorgänger.

also sowas:

|-----------------------------------------------------------|
| Start               | End                 | Count | Delta |
|-----------------------------------------------------------|
| 2006-09-19 00:00:00 | 2006-09-19 01:00:00 |     1 |     0 |
| 2006-09-19 00:00:00 | 2006-09-19 02:00:00 |     8 |     7 |
| 2006-09-19 00:00:00 | 2006-09-19 03:00:00 |    19 |    11 |
| 2006-09-19 00:00:00 | 2006-09-19 04:00:00 |    49 |    30 |
| 2006-09-19 00:00:00 | 2006-09-19 05:00:00 |   110 |    61 |
| 2006-09-19 00:00:00 | 2006-09-19 06:00:00 |   212 |   112 |
|-----------------------------------------------------------|


natürlich will ich das nicht in er tabelle speichern, sondern nur mit meiner query berechnen lassen!\n\n

<!--EDIT|esskar|1159433322-->

View full thread esskar in der SQL welt