{"id":1284,"date":"2013-09-23T07:52:52","date_gmt":"2013-09-23T07:52:52","guid":{"rendered":"http:\/\/www.websitedesignwebsitedevelopment.com\/?p=1284"},"modified":"2014-03-19T09:13:38","modified_gmt":"2014-03-19T09:13:38","slug":"complex-mysql-query","status":"publish","type":"post","link":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/","title":{"rendered":"A complex mysql &#8220;over&#8221; query"},"content":{"rendered":"<h2>A complex mysql &#8220;over&#8221; query<\/h2>\n<p><code>SELECT Candidates.CID, Candidates.NAME, Candidate_Scores.SCORE FROM<br \/>\nCandidates,<br \/>\n(SELECT CID, SCORE<br \/>\n    FROM (<br \/>\n        SELECT CID, SCORE, Rank() over (Partition BY CID ORDER BY SCORE DESC ) AS Rank<br \/>\n        FROM Candidate_Scores<br \/>\n        ) rs WHERE Rank <= 3) Candidate_Scores\nWHERE  Candidates.CID = Candidate_Scores.CID<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A complex mysql &#8220;over&#8221; query SELECT Candidates.CID, Candidates.NAME, Candidate_Scores.SCORE FROM Candidates, (SELECT CID, SCORE FROM ( SELECT CID, SCORE, Rank() over (Partition BY CID ORDER BY SCORE DESC ) AS Rank FROM Candidate_Scores ) rs WHERE Rank<\/p>\n","protected":false},"author":1,"featured_media":72,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-1284","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A complex mysql &quot;over&quot; query<\/title>\n<meta name=\"description\" content=\"A complex mysql &quot;over&quot; query\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A complex mysql &quot;over&quot; query\" \/>\n<meta property=\"og:description\" content=\"A complex mysql &quot;over&quot; query\" \/>\n<meta property=\"og:url\" content=\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/\" \/>\n<meta property=\"og:site_name\" content=\"AndroidBubble Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-23T07:52:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-03-19T09:13:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png\" \/>\n\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t<meta property=\"og:image:height\" content=\"181\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Fahad\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fahad\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/\"},\"author\":{\"name\":\"Fahad\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"headline\":\"A complex mysql &#8220;over&#8221; query\",\"datePublished\":\"2013-09-23T07:52:52+00:00\",\"dateModified\":\"2014-03-19T09:13:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/\"},\"wordCount\":10,\"image\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png\",\"articleSection\":[\"MySql\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/\",\"url\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/\",\"name\":\"A complex mysql \\\"over\\\" query\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png\",\"datePublished\":\"2013-09-23T07:52:52+00:00\",\"dateModified\":\"2014-03-19T09:13:38+00:00\",\"author\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"description\":\"A complex mysql \\\"over\\\" query\",\"breadcrumb\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage\",\"url\":\"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png\",\"contentUrl\":\"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png\",\"width\":\"350\",\"height\":\"181\",\"caption\":\"mysql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/androidbubble.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Website Development\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PHP Frameworks\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Wordpress\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"MySql\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/wordpress\/mysql\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"A complex mysql &#8220;over&#8221; query\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\",\"url\":\"https:\/\/androidbubble.com\/blog\/\",\"name\":\"AndroidBubble Blog\",\"description\":\"Articles &amp; Posts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/androidbubble.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\",\"name\":\"Fahad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"caption\":\"Fahad\"},\"sameAs\":[\"http:\/\/www.androidbubbles.com\/\",\"https:\/\/x.com\/phpFlex\"],\"url\":\"https:\/\/androidbubble.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A complex mysql \"over\" query","description":"A complex mysql \"over\" query","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/","og_locale":"en_US","og_type":"article","og_title":"A complex mysql \"over\" query","og_description":"A complex mysql \"over\" query","og_url":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/","og_site_name":"AndroidBubble Blog","article_publisher":"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453","article_published_time":"2013-09-23T07:52:52+00:00","article_modified_time":"2014-03-19T09:13:38+00:00","og_image":[{"width":350,"height":181,"url":"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png","type":"image\/png"}],"author":"Fahad","twitter_misc":{"Written by":"Fahad"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#article","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/"},"author":{"name":"Fahad","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"headline":"A complex mysql &#8220;over&#8221; query","datePublished":"2013-09-23T07:52:52+00:00","dateModified":"2014-03-19T09:13:38+00:00","mainEntityOfPage":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/"},"wordCount":10,"image":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage"},"thumbnailUrl":"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png","articleSection":["MySql"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/","url":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/","name":"A complex mysql \"over\" query","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage"},"image":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage"},"thumbnailUrl":"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png","datePublished":"2013-09-23T07:52:52+00:00","dateModified":"2014-03-19T09:13:38+00:00","author":{"@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"description":"A complex mysql \"over\" query","breadcrumb":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#primaryimage","url":"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png","contentUrl":"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png","width":"350","height":"181","caption":"mysql"},{"@type":"BreadcrumbList","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/wordpress\/mysql\/complex-mysql-query\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/androidbubble.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Website Development","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/"},{"@type":"ListItem","position":3,"name":"PHP Frameworks","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/"},{"@type":"ListItem","position":4,"name":"Wordpress","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/wordpress\/"},{"@type":"ListItem","position":5,"name":"MySql","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/wordpress\/mysql\/"},{"@type":"ListItem","position":6,"name":"A complex mysql &#8220;over&#8221; query"}]},{"@type":"WebSite","@id":"https:\/\/androidbubble.com\/blog\/#website","url":"https:\/\/androidbubble.com\/blog\/","name":"AndroidBubble Blog","description":"Articles &amp; Posts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/androidbubble.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7","name":"Fahad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","caption":"Fahad"},"sameAs":["http:\/\/www.androidbubbles.com\/","https:\/\/x.com\/phpFlex"],"url":"https:\/\/androidbubble.com\/blog\/author\/admin\/"}]}},"views":331,"jetpack_featured_media_url":"https:\/\/androidbubble.com\/blog\/wp-content\/uploads\/2011\/06\/mysql.png","_links":{"self":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/1284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/comments?post=1284"}],"version-history":[{"count":2,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/1284\/revisions"}],"predecessor-version":[{"id":1469,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/1284\/revisions\/1469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/media\/72"}],"wp:attachment":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/media?parent=1284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/categories?post=1284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/tags?post=1284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}