Hello
I am running MySQL 5.0.21 and am trying to run a query on a query and not sure how to do it. I was hoping someone could advise.
I have a table that has a whole ton of fields. I call the following query on this table:
SELECT *, -(vy0+sqrt(vy0*vy0-2*(y0-17/12)*ay))/ay AS time_to_plate, if(y0=50,-(vy0+sqrt(vy0*vy0-2*(50-17/12)*ay))/ay,if(y0=55,(-sqrt(vy0*vy0-2*(55-17/12)*ay)+sqrt(vy0*vy0-2*5*ay))/ay,if(y0=40,(-sqrt(vy0*vy0-2*(40-17/12)*ay)+sqrt(vy0*vy0+20*ay))/ay,0))) as time_50ft
FROM pitches LEFT JOIN (atbats LEFT JOIN players ON atbats.pitcher = players.eliasid)
ON pitches.ab_id = atbats.ab_id
WHERE
players.last = 'Smoltz' AND
players.`first` = 'John' AND
pitches.start_speed IS NOT NULL
You can see the complex formula that I use. I now need to use this calc (eg, time_to_plate) as part of another formula. Hence I wanted to query this query but can't seem to do it in MySQL.
You can do it in Access so I assume there is a work around. Help VERY much appreciated
Thanks
John