The above works fine return results as expectedCode:SELECT t . * , sp.system_postcode_postcode, ( SQRT( ( ( 5607 - sp.system_postcode_east ) * ( 5607 - sp.system_postcode_east ) ) + ( ( 2598 - sp.system_postcode_north ) * ( 2598 - sp.system_postcode_north ) ) ) /22 ) AS chris_dist FROM another_table t LEFT JOIN system_postcode sp ON sp.system_postcode_postcode = t.another_table_postcode LIMIT 30
This one doesn't return any errors, but the 'sp.system_postcode_postcode' field and the 'chris_dist' field appear as NULL. Why would the ORDER BY part make fields null out?Code:SELECT t . * , sp.system_postcode_postcode, ( SQRT( ( ( 5607 - sp.system_postcode_east ) * ( 5607 - sp.system_postcode_east ) ) + ( ( 2598 - sp.system_postcode_north ) * ( 2598 - sp.system_postcode_north ) ) ) /22 ) AS chris_dist FROM another_table t LEFT JOIN system_postcode sp ON sp.system_postcode_postcode = t.another_table_postcode ORDER BY chris_dist LIMIT 30
Im confuzzled : /


LinkBack URL
About LinkBacks
Reply With Quote
abit.care@HEXUS
SCAN.care@HEXUS
