Skip to content

Instantly share code, notes, and snippets.

@mmcachran
Last active August 29, 2015 14:21
Show Gist options
  • Save mmcachran/052a24dd3d1465e58f7a to your computer and use it in GitHub Desktop.
Save mmcachran/052a24dd3d1465e58f7a to your computer and use it in GitHub Desktop.

Revisions

  1. mmcachran revised this gist May 26, 2015. No changes.
  2. mmcachran revised this gist May 26, 2015. No changes.
  3. mmcachran revised this gist May 26, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sql
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ FROM wp_posts
    WHERE
    wp_posts.post_status = 'publish'
    AND wp_posts.post_parent = 0
    AND wp_term_taxonomy.taxonomy = 'topic'
    AND wp_term_taxonomy.taxonomy = 'category'
    AND wp_terms.name LIKE '%App%'
    ORDER BY
    wp_terms.name ASC
  4. mmcachran revised this gist May 26, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.sql
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    SELECT DISTINCT
    post_title,
    post_type,
    wp_terms.*
    post_title,
    post_type,
    wp_terms.*
    FROM wp_posts
    LEFT JOIN wp_postmeta
    ON(wp_posts.id = wp_postmeta.post_id)
  5. mmcachran revised this gist May 26, 2015. 1 changed file with 16 additions and 16 deletions.
    32 changes: 16 additions & 16 deletions gistfile1.sql
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,21 @@
    SELECT DISTINCT
    post_title,
    post_type,
    ig_terms.*
    FROM ig_posts
    LEFT JOIN ig_postmeta
    ON(ig_posts.id = ig_postmeta.post_id)
    LEFT JOIN ig_term_relationships
    ON(ig_posts.id = ig_term_relationships.object_id)
    INNER JOIN ig_term_taxonomy
    ON(ig_term_relationships.term_taxonomy_id =
    ig_term_taxonomy.term_taxonomy_id)
    INNER JOIN ig_terms
    ON(ig_terms.term_id = ig_term_taxonomy.term_id)
    wp_terms.*
    FROM wp_posts
    LEFT JOIN wp_postmeta
    ON(wp_posts.id = wp_postmeta.post_id)
    LEFT JOIN wp_term_relationships
    ON(wp_posts.id = wp_term_relationships.object_id)
    INNER JOIN wp_term_taxonomy
    ON(wp_term_relationships.term_taxonomy_id =
    wp_term_taxonomy.term_taxonomy_id)
    INNER JOIN wp_terms
    ON(wp_terms.term_id = wp_term_taxonomy.term_id)
    WHERE
    ig_posts.post_status = 'publish'
    AND ig_posts.post_parent = 0
    AND ig_term_taxonomy.taxonomy = 'topic'
    AND ig_terms.name LIKE '%App%'
    wp_posts.post_status = 'publish'
    AND wp_posts.post_parent = 0
    AND wp_term_taxonomy.taxonomy = 'topic'
    AND wp_terms.name LIKE '%App%'
    ORDER BY
    ig_terms.name ASC
    wp_terms.name ASC
  6. mmcachran created this gist May 26, 2015.
    21 changes: 21 additions & 0 deletions gistfile1.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    SELECT DISTINCT
    post_title,
    post_type,
    ig_terms.*
    FROM ig_posts
    LEFT JOIN ig_postmeta
    ON(ig_posts.id = ig_postmeta.post_id)
    LEFT JOIN ig_term_relationships
    ON(ig_posts.id = ig_term_relationships.object_id)
    INNER JOIN ig_term_taxonomy
    ON(ig_term_relationships.term_taxonomy_id =
    ig_term_taxonomy.term_taxonomy_id)
    INNER JOIN ig_terms
    ON(ig_terms.term_id = ig_term_taxonomy.term_id)
    WHERE
    ig_posts.post_status = 'publish'
    AND ig_posts.post_parent = 0
    AND ig_term_taxonomy.taxonomy = 'topic'
    AND ig_terms.name LIKE '%App%'
    ORDER BY
    ig_terms.name ASC