Re: SQL challenge

2004-06-29 Thread SGreen
8/2004 04:17 Subject: Re: SQL challenge

Re: SQL challenge

2004-06-29 Thread Jigal van Hemert
> 1. The average TIME ELAPSED between consecutive REPEATED instances of the > rowID (GROUP BY rowID, I assume) between one month ago and now. The easiest solution (if not the only) would be to handle this client side. If you sort the records by their timestamp you can easily keep track of the tim

Re: SQL challenge

2004-06-28 Thread John Mistler
Wow, that was it! I changed the WHERE to (because I wasn't clear): . . . WHERE theDate BETWEEN SUBDATE(CURDATE(), INTERVAL 1 MONTH) AND CURDATE() . . . Now, I have just one more that I still am stumped by, if anyone (Roger or other) has a second: Given theTable with 2 columns: rowID (MEDIUMINT

Re: SQL challenge

2004-06-28 Thread Roger Baklund
* John Mistler > I have a difficult query for you that has me stumped. The table has two > columns: rowID (MEDIUMINT-but *NOT* AUTO_INCREMENT) and theDate > (DATETIME). > I need it to find: > > 1. The COUNT of REPEATED instances of the rowID in the last month. > > - so if there are 5 rows with the

Re: SQL challenge

2004-06-28 Thread Jigal van Hemert
From: "John Mistler" <[EMAIL PROTECTED]> > I have a difficult query for you that has me stumped. The table has two > columns: rowID (MEDIUMINT-but *NOT* AUTO_INCREMENT) and theDate (DATETIME). > I need it to find: > > 1. The COUNT of REPEATED instances of the rowID in the last month. This is rela

Re: SQL challenge

2004-06-28 Thread Martijn Tonies
Hi John, > O.K. you SQL gurus-- > > I have a difficult query for you that has me stumped. The table has two > columns: rowID (MEDIUMINT-but *NOT* AUTO_INCREMENT) and theDate (DATETIME). > I need it to find: > > 1. The COUNT of REPEATED instances of the rowID in the last month. > > - so if there