Need help understanding this sql

maymnenalpBaf

New Member
I'm trying to decipher this SQL statement. Specifically, what locations z, locations o, locations a mean. What do z o and a mean in this case? Confused :(\[code\]SELECT o.zip_codeFROM locations z, locations o, locations aWHERE z.zip_code = #{zip_code}AND z.zip_code = a.zip_codeAND (3956 * (2 * ASIN(SQRT( POWER(SIN(((z.latitude-o.latitude)*0.017453293)/2),2) + COS(z.latitude*0.017453293) * COS(o.latitude*0.017453293) * POWER(SIN(((z.longitude-o.longitude)*0.017453293)/2),2) )))) <= #{distance}\[/code\]
 
Top