{"id":76653,"date":"2025-03-14T03:18:28","date_gmt":"2025-03-14T03:18:28","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=76653"},"modified":"2025-03-14T03:18:29","modified_gmt":"2025-03-14T03:18:29","slug":"oracle-case-within-select","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76653","title":{"rendered":"Oracle CASE within SELECT"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">From: <a href=\"https:\/\/docs.oracle.com\/cd\/B19306_01\/server.102\/b14200\/expressions004.htm\">https:\/\/docs.oracle.com\/cd\/B19306_01\/server.102\/b14200\/expressions004.htm<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"544\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/03\/image.png?resize=741%2C544\" alt=\"\" class=\"wp-image-76654\" style=\"width:840px;height:auto\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/03\/image.png?w=741 741w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/03\/image.png?resize=300%2C220 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Write a SQL block that will categorize Customers&#8217; Credit Limit. If the limit is > 5000, show high, when 100 show low otherwise show medium. Utilize CASE statement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT cust_last_name,\n   CASE credit_limit WHEN 100 THEN 'Low'\n   WHEN 5000 THEN 'High'\n   ELSE 'Medium' END\n   FROM customers;\n\nCUST_LAST_NAME       CASECR\n-------------------- ------\n...\nBogart               Medium\nNolte                Medium\nLoren                Medium<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>From: https:\/\/docs.oracle.com\/cd\/B19306_01\/server.102\/b14200\/expressions004.htm Syntax: Example: Write a SQL block that will categorize Customers&#8217; Credit Limit. If the limit is > 5000, show high, when 100 show low otherwise show medium. Utilize CASE statement. SELECT cust_last_name, CASE credit_limit WHEN 100 THEN &#8216;Low&#8217; WHEN 5000 THEN &#8216;High&#8217; ELSE &#8216;Medium&#8217; END FROM customers; CUST_LAST_NAME CASECR &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212; &#8230; Bogart &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=76653\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-76653","post","type-post","status-publish","format-standard","hentry","category-root","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":72712,"url":"http:\/\/bangla.sitestree.com\/?p=72712","url_meta":{"origin":76653,"position":0},"title":"Strategy: Buy the Dip or Not? Where to retire with Spend limit $4000 to $5000 a month","author":"Sayed","date":"February 7, 2022","format":false,"excerpt":"Buy the dip? Why the stock market\u2019s bounce off January lows may prove premature https:\/\/www.marketwatch.com\/story\/stock-market-bounce-why-it-may-be-too-soon-to-go-all-in-on-buying-the-dip-11644261088 We want to retire to a place with lots of cultural activities, a beach and a major airport. Our budget is $4,000-$5,500 a month, including rent \u2014 so where should we look? https:\/\/www.marketwatch.com\/story\/we-want-to-retire-to-a-place-with-lots-of-cultural-activities-a-beach-and-a-major-airport-our-budget-is-4-000-5-500-a-month-including-rent-so-where-should-we-look-11644250128","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":74657,"url":"http:\/\/bangla.sitestree.com\/?p=74657","url_meta":{"origin":76653,"position":1},"title":"Python and MySQL Operations. Code Examples","author":"Sayed","date":"May 17, 2022","format":false,"excerpt":"#!\/usr\/bin\/env python# coding: utf-8# In[1]: import mysql.connector # In[2]: # create a database connection # In[3]: import mysql.connectormydb = mysql.connector.connect(\u00a0 host=\"localhost\",\u00a0 user=\"root\",\u00a0 password=\"\")print(mydb) # In[4]: import mysql.connectormydb = mysql.connector.connect(\u00a0 host=\"localhost\",\u00a0 user=\"root\",\u00a0 password=\"\")mycursor = mydb.cursor()mycursor.execute(\"drop DATABASE mydatabase\");mycursor.execute(\"CREATE DATABASE mydatabase\"); # In[5]: # check if database exists # In[6]: import mysql.connectormydb =\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/bangla.sitestree.com\/?cat=1428"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68823,"url":"http:\/\/bangla.sitestree.com\/?p=68823","url_meta":{"origin":76653,"position":2},"title":"Magento 2: Update data for a custom product attribute","author":"Sayed","date":"August 6, 2021","format":false,"excerpt":"use bitnami_magento; SELECT * FROM bitnami_magento.catalog_product_entity_varcharwhere ( attribute_id = 73 ) -- and (value = '')limit 10 replace into bitnami_magento.catalog_product_entity_varchar (attribute_id, store_id, entity_id, value )SELECT 181, 0, product.entity_id, left(concat(\"https:\/\/www.amazon.com\/s?k=\", product.value),255)FROM bitnami_magento.catalog_product_entity_varchar productinner join catalog_product_entity_int status_t on ( status_t.entity_id = product.entity_id ) and ( status_t.attribute_id = 97 and status_t.value = 1\u2026","rel":"","context":"In &quot;Magento 2 : Operations using SQL&quot;","block_context":{"text":"Magento 2 : Operations using SQL","link":"http:\/\/bangla.sitestree.com\/?cat=1942"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6101,"url":"http:\/\/bangla.sitestree.com\/?p=6101","url_meta":{"origin":76653,"position":3},"title":"\u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf &#8211; \u09ae\u09be\u0987\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2 \u09a5\u09c7\u0995\u09c7 \u09a1\u09be\u099f\u09be \u09b8\u09bf\u09b2\u09c7\u0995\u09b6\u09a8 \u09a8\u09bf\u09b0\u09cd\u09a6\u09bf\u09b7\u09cd\u099f \u0995\u09b0\u09be  (PHP Limit Data Selections From MySQL in Bangla)","author":"Author-Check- Article-or-Video","date":"February 16, 2015","format":false,"excerpt":"MYSQL \u098f\u09b0 LIMIT \u09aa\u09cd\u09af\u09be\u09b0\u09be\u09ae\u09bf\u099f\u09be\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c7 \u09a8\u09bf\u09b0\u09cd\u09a6\u09bf\u09b7\u09cd\u099f \u09b8\u0982\u0996\u09cd\u09af\u0995 \u09b0\u09cb \u09aa\u09be\u0993\u09df\u09be \u09af\u09be\u09df\u0964 \u0985\u09a8\u09c7\u0995\u0997\u09c1\u09b2\u09cb \u09aa\u09c7\u099c \u098f \u09ab\u09b2\u09be\u09ab\u09b2 \u09a1\u09bf\u09b8\u09aa\u09cd\u09b2\u09c7 \u0995\u09b0\u09a4\u09c7 \u0985\u09a5\u09ac\u09be pagination \u098f\u09b0 \u0995\u09cd\u09b7\u09c7\u09a4\u09cd\u09b0\u09c7 LIMIT \u09aa\u09cd\u09af\u09be\u09b0\u09be\u09ae\u09bf\u099f\u09be\u09b0 \u099f\u09be \u0996\u09c1\u09ac \u09b8\u09b9\u099c\u0964 \u0985\u09a8\u09c7\u0995 \u09ac\u09dc \u099f\u09c7\u09ac\u09bf\u09b2 \u098f\u09b0 \u099c\u09a8\u09cd\u09af \u098f\u099f\u09be \u0996\u09c1\u09ac \u0989\u09aa\u0995\u09be\u09b0\u09c0\u0964 \u09ae\u09a8\u09c7 \u0995\u09b0\u09bf \u0986\u09ae\u09b0\u09be \u098f\u0995\u099f\u09bf order \u09a8\u09be\u09ae\u0995 \u099f\u09c7\u09ac\u09bf\u09b2 \u09a5\u09c7\u0995\u09c7 \u09aa\u09cd\u09b0\u09a5\u09ae \u09e9\u09e6 \u099f\u09be \u09a1\u09be\u099f\u09be \u09a6\u09c7\u0996\u09a4\u09c7 \u099a\u09be\u0987 \u09a4\u09be\u09b0 \u099c\u09a8\u09cd\u09af\u2026","rel":"","context":"In &quot;\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 \u0964 PHP tutorial&quot;","block_context":{"text":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 \u0964 PHP tutorial","link":"http:\/\/bangla.sitestree.com\/?cat=172"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10130,"url":"http:\/\/bangla.sitestree.com\/?p=10130","url_meta":{"origin":76653,"position":4},"title":"PreparedStatements.java An example to test the timing differences resulting from repeated raw queries vs. repeated calls","author":"","date":"August 7, 2015","format":false,"excerpt":"package cwp; import java.sql.*; \/** An example to test the timing differences resulting \u00a0*\u00a0 from repeated raw queries vs. repeated calls to \u00a0*\u00a0 prepared statements. These results will vary dramatically \u00a0*\u00a0 among database servers and drivers. With my setup \u00a0*\u00a0 and drivers, Oracle prepared statements took only half \u00a0*\u00a0 the\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26854,"url":"http:\/\/bangla.sitestree.com\/?p=26854","url_meta":{"origin":76653,"position":5},"title":"PreparedStatements.java  An example to test the timing differences resulting from repeated raw queries vs. repeated calls #Programming Code Examples #Java\/J2EE\/J2ME #JDBC","author":"Author-Check- Article-or-Video","date":"May 3, 2021","format":false,"excerpt":"package cwp; import java.sql.*; \/** An example to test the timing differences resulting * from repeated raw queries vs. repeated calls to * prepared statements. These results will vary dramatically * among database servers and drivers. With my setup * and drivers, Oracle prepared statements took only half * the\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76653"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76653\/revisions"}],"predecessor-version":[{"id":76655,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76653\/revisions\/76655"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76653"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}