{"id":27454,"date":"2025-08-13T15:15:21","date_gmt":"2025-08-13T12:15:21","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/"},"modified":"2025-08-13T15:15:21","modified_gmt":"2025-08-13T12:15:21","slug":"postgresql-case-when-ile-ayri-degerlerin-sayimi","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/","title":{"rendered":"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI"},"content":{"rendered":"<p># PostgreSQL&#8217;de COUNT DISTINCT ile CASE WHEN Kullan\u0131m\u0131: Tam Bir Rehber<\/p>\n<p>PostgreSQL veritaban\u0131n\u0131zda farkl\u0131 ko\u015fullara ba\u011fl\u0131 olarak benzersiz de\u011fer say\u0131lar\u0131n\u0131 sayman\u0131z m\u0131 gerekiyor?  \u00d6rne\u011fin, bir e-ticaret sitesinde, her kategoride ka\u00e7 farkl\u0131 \u00fcr\u00fcn oldu\u011funu veya bir m\u00fc\u015fteri ili\u015fkileri y\u00f6netim sisteminde, her b\u00f6lgede ka\u00e7 farkl\u0131 m\u00fc\u015fteri temsilcisinin \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131 \u00f6\u011frenmek isteyebilirsiniz. \u0130\u015fte tam bu noktada <code class=\"language-\">COUNT DISTINCT<\/code> ve <code class=\"language-\">CASE WHEN<\/code> kombinasyonu devreye giriyor. Bu makale, PostgreSQL&#8217;de bu g\u00fc\u00e7l\u00fc fonksiyonlar\u0131n nas\u0131l birlikte kullan\u0131laca\u011f\u0131n\u0131, performans optimizasyonunu ve ger\u00e7ek d\u00fcnya senaryolar\u0131n\u0131 ad\u0131m ad\u0131m a\u00e7\u0131klayacak.<\/p>\n<p><strong>\u00d6\u011frenme Yol Haritas\u0131:<\/strong><\/p>\n<p>* <strong>Yeni Ba\u015flayan:<\/strong> Temel Kavramlar, Basit Kod \u00d6rnekleri<br \/>\n* <strong>Orta Seviye:<\/strong> Ger\u00e7ek Hayat \u00d6rnekleri, Optimizasyon \u0130pu\u00e7lar\u0131<br \/>\n* <strong>\u0130leri Seviye:<\/strong> Performans Analizi, Edge Case&#8217;ler ve Karma\u015f\u0131k Sorgu Optimizasyonu<\/p>\n<p><strong>1. Temel Kavramlar: COUNT DISTINCT ve CASE WHEN<\/strong><\/p>\n<p><code class=\"language-\">COUNT DISTINCT<\/code>, bir s\u00fct\u00fcndaki benzersiz de\u011ferlerin say\u0131s\u0131n\u0131 hesaplamak i\u00e7in kullan\u0131lan bir PostgreSQL fonksiyonudur.  \u00d6rne\u011fin, <code class=\"language-\">SELECT COUNT(DISTINCT product_id) FROM products;<\/code> sorgusu, <code class=\"language-\">products<\/code> tablosundaki farkl\u0131 \u00fcr\u00fcn kimliklerinin say\u0131s\u0131n\u0131 verir.<\/p>\n<p><code class=\"language-\">CASE WHEN<\/code> ise ko\u015fullu i\u015flemler ger\u00e7ekle\u015ftirmek i\u00e7in kullan\u0131l\u0131r.  Bir ko\u015ful do\u011fruysa bir de\u011fer, yanl\u0131\u015fsa ba\u015fka bir de\u011fer d\u00f6nd\u00fcr\u00fcr.  Genel yap\u0131s\u0131 \u015f\u00f6yledir:<\/p>\n<pre class=\"language-sql\"><code>CASE\n    WHEN condition1 THEN result1\n    WHEN condition2 THEN result2\n    ELSE result3\nEND<\/code><\/pre>\n<p>Bu iki fonksiyonu birle\u015ftirerek, farkl\u0131 ko\u015fullar alt\u0131nda benzersiz de\u011ferlerin say\u0131s\u0131n\u0131 hesaplayabiliriz.<\/p>\n<p><strong>2. PostgreSQL&#8217;de COUNT DISTINCT ile CASE WHEN Nas\u0131l Kullan\u0131l\u0131r? (Ad\u0131m Ad\u0131m)<\/strong><\/p>\n<p>Bir \u00f6rnek \u00fczerinden gidelim.  <code class=\"language-\">urunler<\/code> ad\u0131nda bir tablomuz olsun ve bu tabloda <code class=\"language-\">kategori_id<\/code> ve <code class=\"language-\">urun_adi<\/code> s\u00fctunlar\u0131 bulunsun.  Her kategoride ka\u00e7 farkl\u0131 \u00fcr\u00fcn oldu\u011funu bulmak i\u00e7in a\u015fa\u011f\u0131daki sorguyu kullanabiliriz:<\/p>\n<pre class=\"language-sql\"><code>SELECT\n    CASE\n        WHEN kategori_id = 1 THEN 'Elektronik'\n        WHEN kategori_id = 2 THEN 'Giyim'\n        WHEN kategori_id = 3 THEN 'Kitap'\n        ELSE 'Di\u011fer'\n    END AS kategori_adi,\n    COUNT(DISTINCT urun_adi) AS farkli_urun_sayisi\nFROM\n    urunler\nGROUP BY\n    kategori_adi;<\/code><\/pre>\n<p>Bu sorgu, \u00f6nce <code class=\"language-\">CASE WHEN<\/code> ifadesiyle <code class=\"language-\">kategori_id<\/code> de\u011ferlerine g\u00f6re kategori adlar\u0131n\u0131 belirler. Daha sonra, <code class=\"language-\">COUNT(DISTINCT urun_adi)<\/code> ile her kategori i\u00e7in farkl\u0131 \u00fcr\u00fcn isimlerinin say\u0131s\u0131n\u0131 hesaplar ve <code class=\"language-\">GROUP BY<\/code> ile kategorilere g\u00f6re gruplar.<\/p>\n<p><strong>3. Ger\u00e7ek Hayat \u00d6rne\u011fi: E-Ticaret Veri Analizi<\/strong><\/p>\n<p>Bir e-ticaret \u015firketinde, son bir ayda her \u00f6deme y\u00f6ntemiyle yap\u0131lan ka\u00e7 farkl\u0131 sipari\u015f oldu\u011funu bulmak isteyelim.  <code class=\"language-\">siparisler<\/code> tablomuzda <code class=\"language-\">odeme_yontemi<\/code> ve <code class=\"language-\">siparis_id<\/code> s\u00fctunlar\u0131 bulunmaktad\u0131r.<\/p>\n<pre class=\"language-sql\"><code>SELECT\n    odeme_yontemi,\n    COUNT(DISTINCT siparis_id) AS farkli_siparis_sayisi\nFROM\n    siparisler\nWHERE\n    siparis_tarihi &gt;= NOW() - INTERVAL '1 month'\nGROUP BY\n    odeme_yontemi;<\/code><\/pre>\n<p>Bu sorgu, son bir aydaki sipari\u015fleri filtreler ve her \u00f6deme y\u00f6ntemi i\u00e7in farkl\u0131 sipari\u015f say\u0131s\u0131n\u0131 hesaplar.  <code class=\"language-\">CASE WHEN<\/code> kullanmadan direkt olarak <code class=\"language-\">odeme_yontemi<\/code> s\u00fctununu grupland\u0131rarak benzersiz sipari\u015f say\u0131s\u0131n\u0131 elde ederiz.<\/p>\n<p><strong>4. Performans Optimizasyonu \u0130pu\u00e7lar\u0131<\/strong><\/p>\n<p><code class=\"language-\">COUNT DISTINCT<\/code> i\u015flemleri, \u00f6zellikle b\u00fcy\u00fck tablolarda performans sorunlar\u0131na yol a\u00e7abilir. \u0130\u015fte baz\u0131 optimizasyon ipu\u00e7lar\u0131:<\/p>\n<p>* <strong>\u0130ndeksler:<\/strong> <code class=\"language-\">COUNT DISTINCT<\/code> i\u015flemini uygulad\u0131\u011f\u0131n\u0131z s\u00fctundaki bir indeks, sorgu performans\u0131n\u0131 \u00f6nemli \u00f6l\u00e7\u00fcde art\u0131rabilir.<br \/>\n* <strong>WHERE ko\u015fullar\u0131:<\/strong>  Sorguya bir <code class=\"language-\">WHERE<\/code> ko\u015fulu ekleyerek, <code class=\"language-\">COUNT DISTINCT<\/code> i\u015fleminin uygulanaca\u011f\u0131 sat\u0131r say\u0131s\u0131n\u0131 azaltabilirsiniz.<br \/>\n* <strong>Materyalize G\u00f6r\u00fcn\u00fcmler (Materialized Views):<\/strong>  S\u0131k\u00e7a kullan\u0131lan <code class=\"language-\">COUNT DISTINCT<\/code> sorgular\u0131n\u0131n sonu\u00e7lar\u0131n\u0131 \u00f6nceden hesaplay\u0131p saklamak i\u00e7in materyalize g\u00f6r\u00fcn\u00fcmler kullanabilirsiniz.  Bu, sorgu performans\u0131n\u0131 \u00f6nemli \u00f6l\u00e7\u00fcde iyile\u015ftirebilir.  Fatih Soysal&#8217;\u0131n [https:\/\/fatihsoysal.com](https:\/\/fatihsoysal.com) sitesinde materyalize g\u00f6r\u00fcn\u00fcmler hakk\u0131nda daha fazla bilgi bulabilirsiniz.<br \/>\n* <strong>Analitik Fonksiyonlar:<\/strong> Baz\u0131 durumlarda, <code class=\"language-\">COUNT DISTINCT<\/code> yerine analitik fonksiyonlar (\u00f6rne\u011fin, <code class=\"language-\">RANK()<\/code>, <code class=\"language-\">DENSE_RANK()<\/code>) kullanmak daha performansl\u0131 olabilir.<\/p>\n<p><strong>5. \u0130leri Seviye Teknikler: Karma\u015f\u0131k Sorgu \u00d6rnekleri ve Edge Case&#8217;ler<\/strong><\/p>\n<p>\u015eimdiye kadar basit \u00f6rnekler verdik. Ancak, ger\u00e7ek d\u00fcnya senaryolar\u0131 daha karma\u015f\u0131k olabilir. \u00d6rne\u011fin, birden fazla ko\u015fulu ayn\u0131 anda de\u011ferlendirmeniz veya NULL de\u011ferlerle ba\u015fa \u00e7\u0131kman\u0131z gerekebilir.<\/p>\n<p>\u00d6rnek olarak,  <code class=\"language-\">urunler<\/code> tablosuna bir <code class=\"language-\">indirimli_mi<\/code> s\u00fctunu ekleyelim (boolean).  \u0130ndirimli ve indirimsiz \u00fcr\u00fcnler i\u00e7in ayr\u0131 ayr\u0131 kategori baz\u0131nda farkl\u0131 \u00fcr\u00fcn say\u0131s\u0131n\u0131 bulmak isteyelim:<\/p>\n<pre class=\"language-sql\"><code>SELECT\n    kategori_adi,\n    indirim_durumu,\n    COUNT(DISTINCT urun_adi) AS farkli_urun_sayisi\nFROM (\n    SELECT\n        CASE\n            WHEN kategori_id = 1 THEN 'Elektronik'\n            WHEN kategori_id = 2 THEN 'Giyim'\n            ELSE 'Di\u011fer'\n        END AS kategori_adi,\n        CASE\n            WHEN indirimli_mi THEN '\u0130ndirimli'\n            ELSE '\u0130ndirimsiz'\n        END AS indirim_durumu,\n        urun_adi\n    FROM\n        urunler\n) AS alt_sorgu\nGROUP BY\n    kategori_adi, indirim_durumu;<\/code><\/pre>\n<p>Bu sorgu, iki <code class=\"language-\">CASE WHEN<\/code> ifadesini kullanarak kategori ve indirim durumunu belirler ve daha sonra <code class=\"language-\">COUNT DISTINCT<\/code> ile her kombinasyon i\u00e7in farkl\u0131 \u00fcr\u00fcn say\u0131s\u0131n\u0131 hesaplar.  \u0130\u00e7 i\u00e7e sorgu kullan\u0131m\u0131, okunabilirli\u011fi art\u0131r\u0131r ve sorgu mant\u0131\u011f\u0131n\u0131 daha net hale getirir.<\/p>\n<p><strong>6. Performans Analizi ve Optimizasyon Stratejileri<\/strong><\/p>\n<p>Karma\u015f\u0131k sorgular\u0131n performans\u0131n\u0131 analiz etmek i\u00e7in PostgreSQL&#8217;in sundu\u011fu ara\u00e7lar\u0131 kullanmal\u0131s\u0131n\u0131z. <code class=\"language-\">EXPLAIN ANALYZE<\/code> komutu, sorgu plan\u0131n\u0131 ve y\u00fcr\u00fctme s\u00fcresini g\u00f6sterir. Bu bilgiye dayanarak, indeks ekleme, sorgu yeniden yazma veya materyalize g\u00f6r\u00fcn\u00fcmler gibi optimizasyon stratejileri uygulayabilirsiniz.  Fatih Soysal&#8217;\u0131n [https:\/\/fatihsoysal.com](https:\/\/fatihsoysal.com) sitesinde PostgreSQL performans optimizasyonu hakk\u0131nda daha fazla kaynak bulabilirsiniz.<\/p>\n<p><strong>7. NULL De\u011ferleri ile Ba\u015f Etme<\/strong><\/p>\n<p><code class=\"language-\">COUNT DISTINCT<\/code> fonksiyonu, NULL de\u011ferleri dikkate almaz.  E\u011fer NULL de\u011ferleri de saymak istiyorsan\u0131z, <code class=\"language-\">COUNT(*)<\/code> fonksiyonunu kullanabilir veya <code class=\"language-\">COALESCE<\/code> fonksiyonu ile NULL de\u011ferlerini bir ba\u015fka de\u011ferle de\u011fi\u015ftirebilirsiniz.<\/p>\n<p><strong>8. Sonu\u00e7<\/strong><\/p>\n<p>PostgreSQL&#8217;de <code class=\"language-\">COUNT DISTINCT<\/code> ve <code class=\"language-\">CASE WHEN<\/code> fonksiyonlar\u0131n\u0131 birlikte kullanarak, farkl\u0131 ko\u015fullara ba\u011fl\u0131 olarak benzersiz de\u011ferlerin say\u0131s\u0131n\u0131 etkili bir \u015fekilde hesaplayabilirsiniz.  Bu makalede verilen \u00f6rnekler ve ipu\u00e7lar\u0131, bu g\u00fc\u00e7l\u00fc fonksiyonlar\u0131 verilerinizi analiz etmek ve i\u015f zekas\u0131 raporlar\u0131 olu\u015fturmak i\u00e7in kullanman\u0131za yard\u0131mc\u0131 olacakt\u0131r.  Ancak, b\u00fcy\u00fck veri k\u00fcmeleriyle \u00e7al\u0131\u015f\u0131rken performans optimizasyonuna dikkat etmek \u00f6nemlidir.  Uygun indeksleme ve sorgu optimizasyon teknikleri kullanarak, sorgular\u0131n\u0131z\u0131n h\u0131z\u0131n\u0131 ve verimlili\u011fini art\u0131rabilirsiniz.<\/p>\n<p><strong>S\u0131k\u00e7a Sorulan Sorular (SSS):<\/strong><\/p>\n<p>1. <strong><code class=\"language-\">COUNT DISTINCT<\/code> i\u015flemi \u00e7ok yava\u015fsa ne yapmal\u0131y\u0131m?<\/strong> \u0130ndeksleme, <code class=\"language-\">WHERE<\/code> ko\u015fullar\u0131 ekleme, materyalize g\u00f6r\u00fcn\u00fcmler ve analitik fonksiyonlar kullanmay\u0131 deneyin.<br \/>\n2. <strong><code class=\"language-\">CASE WHEN<\/code> ifadesinde \u00e7ok fazla ko\u015ful varsa ne olur?<\/strong>  Okunabilirli\u011fi art\u0131rmak i\u00e7in alt sorgular kullan\u0131n veya daha karma\u015f\u0131k ko\u015fullar i\u00e7in fonksiyonlar tan\u0131mlay\u0131n.<br \/>\n3. <strong><code class=\"language-\">COUNT DISTINCT<\/code> NULL de\u011ferleri say\u0131yor mu?<\/strong> Hay\u0131r, saym\u0131yor.  NULL de\u011ferleri saymak i\u00e7in <code class=\"language-\">COUNT(*)<\/code> veya <code class=\"language-\">COALESCE<\/code> fonksiyonunu kullan\u0131n.<br \/>\n4. <strong><code class=\"language-\">COUNT DISTINCT<\/code> ile hangi veri tiplerini kullanabilirim?<\/strong>  Neredeyse t\u00fcm veri tipleriyle kullan\u0131labilir.<br \/>\n5. <strong>PostgreSQL&#8217;de performans optimizasyonu i\u00e7in ba\u015fka hangi teknikleri kullanabilirim?<\/strong>  Fatih Soysal&#8217;\u0131n [https:\/\/fatihsoysal.com](https:\/\/fatihsoysal.com) sitesindeki makaleleri inceleyin.<\/p>\n<p>Yazar: Fatih Soysal<\/p>\n","protected":false},"excerpt":{"rendered":"# PostgreSQL&#8217;de COUNT DISTINCT ile CASE WHEN Kullan\u0131m\u0131: Tam Bir Rehber PostgreSQL veritaban\u0131n\u0131zda farkl\u0131 ko\u015fullara ba\u011fl\u0131 olarak benzersiz&hellip;","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[644],"tags":[],"class_list":{"0":"post-27454","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-postgresql","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI<\/title>\n<meta name=\"description\" content=\"Hi\u00e7bir etiketi bulunamad\u0131.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI\" \/>\n<meta property=\"og:description\" content=\"Hi\u00e7bir etiketi bulunamad\u0131.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T12:15:21+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI\",\"datePublished\":\"2025-08-13T12:15:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/\"},\"wordCount\":936,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#respond\"]}],\"copyrightYear\":\"2025\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/\",\"name\":\"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2025-08-13T12:15:21+00:00\",\"description\":\"Hi\u00e7bir etiketi bulunamad\u0131.\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI","description":"Hi\u00e7bir etiketi bulunamad\u0131.","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:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/","og_locale":"tr_TR","og_type":"article","og_title":"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI","og_description":"Hi\u00e7bir etiketi bulunamad\u0131.","og_url":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2025-08-13T12:15:21+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"6 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI","datePublished":"2025-08-13T12:15:21+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/"},"wordCount":936,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"articleSection":["PostgreSQL"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#respond"]}],"copyrightYear":"2025","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/","url":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/","name":"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2025-08-13T12:15:21+00:00","description":"Hi\u00e7bir etiketi bulunamad\u0131.","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/postgresql-case-when-ile-ayri-degerlerin-sayimi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"PostgreSQL: CASE WHEN ile AYRI DE\u011eERLER\u0130N SAYIMI"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/27454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=27454"}],"version-history":[{"count":0,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/27454\/revisions"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=27454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=27454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=27454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}