Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i sort out 1 row per 10 minutes?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi.

I save stock-quotes in a mysql-database.
Somtimes there are several rows per minutes.
Now i want to plot them on a diagram so i need to get the value of every 10 minutes.

This is my query:

id = Stock id (ERIC B)
tm = time stamp (2001-10-10 15:00:24)
x = stock value (40.20)

select distinct substring(tm,1,16), id, x from index_quote where id = 'ERIC B' and substring(tm,15,2) in ('00','10','20')

I have done do it only shows the rows that came in 00,10,20 minutes. But there are serveral rows per 10 minues step.

How can i do to get 1 row for every 10 minutes?
Does anybody know that?
Please...

Thanks for any help you can give me!
/Dj



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top