Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Logic problem  RSS feed

 
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
Sheriff
Posts: 24216
37
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
Boost this thread!