I have a table with several columns. The ones of interest are flight_id, 
angle, and baseline. I want to find the flight_ids for the flights with the 
maximum and minimum altitudes, where altitude=baseline*tan(radians(angle)).

For example, 
Flights
+------------+----------------+---------------+
| flight_id | angle        | baseline  |
+------------+----------------+---------------+
|       1     | 37.00000 | 100.00000 |
|       2     | 50.00000 | 100.00000 |
|       3     | 48.00000 | 100.00000 |
|       4     | 40.00000 | 100.00000 |
|       5     | 44.00000 | 100.00000 |
|       6     | 40.00000 | 100.00000 |
|       7     | 45.00000 | 100.00000 |
|       8     | 44.00000 |  75.00000 |
|       9     | 57.80000 |  75.00000 |
+------------+----------------+---------------+

The result I am looking for are:

Maximum altitude:
+------------+----------------+
| flight_id | altitude     |
+------------+----------------+
|       2     | 119.17536 | 
|       9     | 119.17536| 
+------------+----------------+

Minimum altitude:
+-----------+-----------+
| flight_id | altitudeM |
+-----------+-----------+
|         8 |  72.42666 |
+-----------+-----------+

Thanks for any help you can provide!

-- 
Mark Phillips
Phillips Marketing, Inc
[EMAIL PROTECTED]
602 524-0376
480 945-9197 fax

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to