Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logic problem

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I take some data from a table in db. I want to perform something once the data in the column changes. For example the column has 1,1,1,2,2,2,2,3,3,3
When at the third number when 1 approaching 2 then i need to make sure that a function is performed. How can I accomplish this? What sql script is useful in this?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rollin park:
I take some data from a table in db. I want to perform something once the data in the column changes. For example the column has 1,1,1,2,2,2,2,3,3,3
When at the third number when 1 approaching 2 then i need to make sure that a function is performed. How can I accomplish this? What sql script is useful in this?

you'll have to track that value, check with every iteration if has changed:

I don't know of any SQL script that will help you with this
Jamie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic