Skip to content

Instantly share code, notes, and snippets.

@fuzzysteve
Created March 7, 2016 15:56
Show Gist options
  • Select an option

  • Save fuzzysteve/53dd6ee022b3e1e679e2 to your computer and use it in GitHub Desktop.

Select an option

Save fuzzysteve/53dd6ee022b3e1e679e2 to your computer and use it in GitHub Desktop.
SQLite query to produce a list of everything in a market group (recursively). Needs at least 3.8
WITH RECURSIVE child_groups(marketGroupID) AS ( Values(4) union select invMarketGroups.marketGroupID from invMarketGroups, child_groups where invMarketGroups.parentGroupID=child_groups.marketGroupID) select typename from child_groups join invTypes on invTypes.marketGroupID=child_groups.marketGroupID order by typename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment