Since the previously posted code was removed I'll try to avoid quoting it too much. Anyway, shouldn't COUNT(is_focus) be replaced with SUM(is_focus) or something along these lines?
Ehm, no as SUM would return the number of all gates at airports marked as focus city. Count only returns the number of fields.
Not quite. Yes, if you were summing gates, but it seems to me that "is_focus" is a bit field describing if a city is a base. In SQL, counting this will in effect count ones and zeros, thus yielding the number of cities where you have gates, not the number of bases.
On another thread (
http://www.stephenm.org/forum/viewtopic.php?p=64199 )...
The number of Engineers is the fleet size divided by 3. [...] Each Engineer is on an annualised salary of €42,000. [...] The AM Monthly cost for an Engineer is 3,500. Due to the cost of running multiple bases, the cost of Engineers are multiplied by the number of bases, divided by 2. (6 bases, 3 times the Engineer Cost)
For Tech Services staff, its the fleet size divided by 3, and a monthly pay of €2,500. There is no penalty for multiple bases, as these staff are in the HQ and not in the Line Station/Base.
Trouble is this month my costs with "Monthly Engineer & Tech Services Salaries" alone were €1,380,453,750. This for 1,584 delivered planes. If you deduct 1584 / 3 * €2500 for Tech Staff, that leaves €1,379,133,750 for engineers. At €3,500 per month, that's over 394
thousand engineers on my payroll! 1584 planes should require 528 times some factor. This factor should be 3.5 (7 bases / 2) but is instead 746.
That or I do indeed employ 394,038 engineers. Small wonder my planes never have problems and are always on time.