1. SELCT query help
Could someone help me with a query?
I have a table with the following fields:
1. Timestamp, datetime
2. ItemName, varchar
3. Value, float
Where the primary key is Timestamp and ItemName.
EX:
1/1/2004 12:00:00, 'ITEM_A', 10.0
1/1/2004 12:00:00, 'ITEM_B', 15.0
1/1/2004 12:00:20, 'ITEM_A', 10.5
1/1/2004 12:00:21, 'ITEM_B', 16.0
1/1/2004 12:00:40, 'ITEM_C', 11.0
1/1/2004 12:00:40, 'ITEM_B', 15.9
1/1/2004 12:00:50, 'ITEM_A', 13.0
1/1/2004 12:00:60, 'ITEM_A', 12.0
etc....
I would like to write a query to retrieve the latest value of a given
set of "ItemNames" for example the most recent values of itemnames
"ITEM_A" and "ITEM_C". The result of the query would be 2 records with
Timestamp, ItemName and Value as fields.
Does anyone know how do do this?
Thanks in advance,
Mike
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
2. Active Scripting Job Steps
3. SELCT INTO #TEMP EXEC SP_NAME
4. License Limits with MSDN SQL 2000 ?
5. putting conditional clauses into SELCT SPs
6. Forcing running total summaries by page?
7. SELCT DISTINCT Help Please
8. SQL 70
9. calling a stored procedure in a selct query
10. SELCT an EXEC
11. selct ... into and union
12. Using code to selct an item from a DBCombo
13. Problems, problems, problems