{"id":25,"date":"2014-05-08T22:25:36","date_gmt":"2014-05-08T22:25:36","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=25"},"modified":"2014-05-08T22:25:36","modified_gmt":"2014-05-08T22:25:36","slug":"sql-select-case","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/sql-select-case\/","title":{"rendered":"SQL select case"},"content":{"rendered":"<p>As mentioned in other posts on SQL. I&#8217;m currently working on a simple database to maintain information on the plants I&#8217;m planting (or looking to plant) this year. I&#8217;m going to use this application to write some &#8220;reminders&#8221; on using SQL.<\/p>\n<p><em>Note: Currently I&#8217;m using SQL Server for this database, so I&#8217;ve only tried this on SQL Server.<\/em><\/p>\n<p><strong>Select<\/strong><\/p>\n<p>A simple example which classifies plants by their maximum height.<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">select Name, MaxHeight,\r\n   case when MaxHeight &gt; 100 then 'Tall'\r\n        when MaxHeight &gt; 50 and MaxHeight &lt;= 100 then 'Medium'\r\n        when MaxHeight &gt; 0 and MaxHeight &lt;= 50 then 'Small'\r\n        else 'No Information'\r\n        end as Height\r\nfrom Plant<\/pre>\n<p><\/br><br \/>\n<strong>Results<\/strong><\/p>\n[table \u201c\u201d not found \/]<br \/>\n\n","protected":false},"excerpt":{"rendered":"<p>As mentioned in other posts on SQL. I&#8217;m currently working on a simple database to maintain information on the plants I&#8217;m planting (or looking to plant) this year. I&#8217;m going to use this application to write some &#8220;reminders&#8221; on using SQL. Note: Currently I&#8217;m using SQL Server for this database, so I&#8217;ve only tried this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[22,10,23],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-database","category-sql","category-sql-server"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":9,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":1983,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/25\/revisions\/1983"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}