Previous Row Comparison

This is a discussion on Previous Row Comparison within the MySQL Database forums, part of the Database Forums category; I have a table in this format: Column A | Column B 1 | 2 1 | 3 1 | 4 2 | 5 ...... ...... What ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-20-2007
Legend
 
Posts: n/a
Default Previous Row Comparison

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?

Reply With Quote
  #2 (permalink)  
Old 10-20-2007
Kees Nuyt
 
Posts: n/a
Default Re: Previous Row Comparison

On Sat, 20 Oct 2007 05:37:38 -0000, Legend
<rahul986@gmail.com> wrote:

>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 - Don't worry, I can handle it. (#441)
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:23 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0