Ok. This is what I think you are wanting.  Have a datetime field or even a
datestamp.  Before you insert, do a select to find the value of the most
recent row that was added then you can calculate what you should insert from
there.

BTW you should include history incase some else has ideas.


----- Original Message -----
From: "Luca Accomazzi" <[EMAIL PROTECTED]>
To: "Rolf Hopkins" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 04, 2001 20:47
Subject: Re: Help! MySQL variables laugh at me


> > I have only had a quick look over this and already have a question for
the
> > simple example you've provided.  How are you determining the last value
> > entered before entering the new value?  The only way I see you of
> > effectively accomplishing this is through the use of a datetime column.
Or
> > am I missing something?
>
> Wait wait wait! I see what you mean. What I'm seeing as a loop (rows upon
> rows of data from the database) is a single query to MySQL. So it's fist
> selecting, then calculating my variable, then sorting. And in sorting, I
see
> "wrong" values for my "is different from the previous" pseudo field.
>
> Glact.
>
> Is there anything I can do to get the functionality I'm after in any other
> way? I seem to remember there's a "having" clause which gets computed in
the
> end?
>
> L.A.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to