Skip to content

Instantly share code, notes, and snippets.

@mmhan
Created March 2, 2012 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmhan/1955202 to your computer and use it in GitHub Desktop.
Save mmhan/1955202 to your computer and use it in GitHub Desktop.
SELECT `p`.`code`, `p`.`building_num`, `w`.`building_number`, `s`.`name`, `b`.`name` FROM postcodes AS `p`
LEFT JOIN `streets` AS `s` ON (`p`.`street_key` = `s`.`id`)
LEFT JOIN `buildings` AS `b` ON (`p`.`building_key` = `b`.`id`)
LEFT JOIN `walkups` AS `w` ON (`w`.`postalcode` = `p`.`code`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment