I think you can just use the TIMEDIFF function. From the manual
TIMEDIFF(expr,expr2)
TIMEDIFF() returns the time between the start time expr and the end time expr2. expr and expr2 are time or date-and-time expressions, but both must be of the same type.
mysql> SELECT TIMEDIFF('2000:01:01...
I'm setting up a new mySQL backed website. Each user needs a database table with about 12 fields that are the same for each user. Users will vary in the number ofrows from about 20 to 200.
I'm trying to decide if I should create a seperate table for each user with the same 12 fields or just...
r937 was absolutely correct. I updated my db to the latest version which includes support for derived tables and everything works like a charm.
Sorry for posting in the wrong group - didn't realize there was a seperate mySQL forum. Still, I would have probably ended up posting here eventually -...
Thanks for the help everyone.
PHV - I was worried about the processing order. Certainly seems to throw a wrench in the works.
LKBrwnDBA - Your suggestion looks like it would work, but I was trying not to compute the trig on all the data twice. I think I could also just repeat in a WHERE...
I'm trying to select stores from a database within 3 miles of a location. I have the longitude and latitude in the database stored in radians to help ease runtime computation.
I want to get distance in the select, where, and order by clauses. In order not to have to do the trig multiple timesI...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.