I have a generic SQL question for the less-newbie-than-me out there.

Imagine I have the following data:

TimeStamp | Person | Data1
-------------------------------
1         | Doug   | X
2         | Doug   | Y
2         | Fred   | A
3         | Doug   | Z
4         | Fred   | B

How do I set all Data1 values for each person to the _first_ value that
was seen for them (X for all Doug Data1 values, A for all Fred Data1
values)?

I get as far as:

UPDATE <table> SET SET Data1=(SELECT Data1 FROM <table> ORDER BY
Timestamp Limit 1) 

but then can't figure out how to handle the per-person part of it (GROUP
BY and HAVING?).

I'm really stuck on this and could benefit from any direction you might
have.

Thank you in advance for any ideas.



This email was sent to you by Reuters, the global news and information company. 
To find out more about Reuters visit www.about.reuters.com

Any views expressed in this message are those of the individual sender, except 
where the sender specifically states them to be the views of Reuters Ltd.


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to