Previous Row Comparison
2 Message(s) by 2 Author(s) originally posted in mysql discussion
| From: Legend |
Date: Saturday, October 20, 2007
|
I have a
table in this format:
Column A | Column B
1 | 2
1 | 3
1 | 4
2 | 5
.....
.....
What I want to do is something like this:
If in Column A there is a change in the number i.e. from the above
table there were many 1s which transitioned into a 2. I want to record
this change. I want to extract these two rows into another table. How
can I make this possible?
| From: Kees Nuyt |
Date: Saturday, October 20, 2007
|
On Sat, 20 Oct 2007 05:37:38 -0000, Legend
wrote in message:
I have a table in this format:
Column A | Column B
1 | 2
1 | 3
1 | 4
2 | 5
.....
.....
What I want to do is something like this:
If in Column A there is a change in the number i.e. from the above
table there were many 1s which transitioned into a 2. I want to record
this change. I want to extract these two rows into another table. How
can I make this possible?
With a trigger.
--
( Kees
)
c[_] Famous last words - Do not worry, I can
handle it. (#441)
Next Message: Need some urgent help in using UPDATE command in SQL