T
Tor Inge Rislaa
Adding dummy lines
Having a special need of adding dummy lines in a select statement.
My select is something like:
Select Field1, Field2, Field3, Field4 From MyTable
The result looks something like
Field1
Field2
Field3
Field4
1000
Variable Text 1
1234
150,20
1050
Variable Text 2
5432
127,10
2120
Variable Text 3
5521
10,42
I need to insert a line in the result between each line, based on some of
the data from the line above. The result should look something like:
Field1
Field2
Field3
Field4
1000
Variable Text 1
1234
150,20
1234
Static Text
1000
-150,20
1050
Variable Text 2
5432
127,10
5432
Static Text
1050
-127,10
2120
Variable Text 3
5521
10,42
5521
Static Text
2120
-10,42
Field1 in the inserted line equals Field3 in the line above and
Field3 in the inserted line equals Field1 in the line above and
The value of Field4 in the inserted line equals the negative value of Field4
in the line above.
Is this possible with an intelligent SQL statement?
TIRislaa
Having a special need of adding dummy lines in a select statement.
My select is something like:
Select Field1, Field2, Field3, Field4 From MyTable
The result looks something like
Field1
Field2
Field3
Field4
1000
Variable Text 1
1234
150,20
1050
Variable Text 2
5432
127,10
2120
Variable Text 3
5521
10,42
I need to insert a line in the result between each line, based on some of
the data from the line above. The result should look something like:
Field1
Field2
Field3
Field4
1000
Variable Text 1
1234
150,20
1234
Static Text
1000
-150,20
1050
Variable Text 2
5432
127,10
5432
Static Text
1050
-127,10
2120
Variable Text 3
5521
10,42
5521
Static Text
2120
-10,42
Field1 in the inserted line equals Field3 in the line above and
Field3 in the inserted line equals Field1 in the line above and
The value of Field4 in the inserted line equals the negative value of Field4
in the line above.
Is this possible with an intelligent SQL statement?
TIRislaa