Skip to content

Instantly share code, notes, and snippets.

@adamreese
Last active August 29, 2015 14:10
Show Gist options
  • Save adamreese/3109b74800a684a7d07b to your computer and use it in GitHub Desktop.
Save adamreese/3109b74800a684a7d07b to your computer and use it in GitHub Desktop.
resources.lob query update
SELECT
`resources`.`id`,
`resources`.`name`,
`resources`.`category`,
`resources`.`type`,
`resources`.`first_action_datekey`,
`resources`.`last_action_datekey`,
`resources`.`lob`,
`downloads`.`path`
FROM `resources`
LEFT JOIN `downloads` ON `resources`.`id` = `downloads`.`resource_id`
WHERE `hide` = 0;
SELECT
`resources`.`id`,
`resources`.`name`,
`resources`.`category`,
`resources`.`type`,
`resources`.`first_action_datekey`,
`resources`.`last_action_datekey`,
`lobs`.`abbreviation`,
`downloads`.`path`
FROM `resources`
LEFT JOIN `lobs` ON `resources`.`lob_id` = `lobs`.`id`
LEFT JOIN `downloads` ON `resources`.`id` = `downloads`.`resource_id`
WHERE `hide` = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment