﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL Server’da CASE WHEN EXISTS &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/sql-serverda-case-when-exists/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Thu, 06 Jan 2022 18:58:41 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
	<item>
		<title>SQL Server’da CASE WHEN EXISTS Kullanımı</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-case-when-exists-kullanimi</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Wed, 05 Feb 2020 06:03:02 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[CASE WHEN EXISTS Kullanımı]]></category>
		<category><![CDATA[SQL Server’da CASE WHEN EXISTS]]></category>
		<category><![CDATA[SQL Server’da CASE WHEN EXISTS Kullanımı]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=9145</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda SQL Server’da case when exists kullanımı hakkında bilgi vereceğim. SQL Server&#8217;da bazı durumlarda case when ile exists komutunu yanyana kullanma ihtiyacınız...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda SQL Server’da case when exists kullanımı hakkında bilgi vereceğim.</p>
<p>SQL Server&#8217;da bazı durumlarda case when ile exists komutunu yanyana kullanma ihtiyacınız olabilir.</p>
<p>Aşağıdaki örnek kod yardımıyla bu işlemi rahatlıkla yapabilirsiniz.</p>
<pre class="line-numbers"><code class="language-sql">--Tabloların oluşturulması

CREATE TABLE Musteriler
(
    MusteriID INT,
    MusteriAdi NVARCHAR(50)
);


CREATE TABLE Siparisler
(
    SiparisID INT,
    MusteriID INT,
    SiparisToplam MONEY
);

--Tablolara kayıt eklenmesi 

INSERT INTO dbo.Musteriler
VALUES
(1, 'Yavuz Selim Kart'),
(2, 'Hasan Ali Kart');
INSERT INTO dbo.Siparisler
VALUES
(100, 1, 1000),
(101, 1, 9500);


--Case When Exist Kullanımı

DECLARE @MusteriID INT = 1;
SELECT (CASE
            WHEN EXISTS
                 (
                     SELECT 1
                     FROM dbo.Siparisler s WITH (NOLOCK)
                         INNER JOIN Musteriler M WITH (NOLOCK)
                             ON s.MusteriID = M.MusteriID
                     WHERE M.MusteriID = @MusteriID
                 ) THEN
                'Kayıt Bulundu'
            ELSE
                'Kayıt Bulunamadı'
        END
       ) AS [Müsteri];</code></pre>
<p>Kodları çalıştırdığınızda aşağıdaki gibi bir sonuç alacaksınız.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-9147 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2020/02/sql-serverda-case-when-exists-kullanimi-1.jpg" alt="SQL Server’da CASE WHEN EXISTS Kullanımı" width="700" height="429" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2020/02/sql-serverda-case-when-exists-kullanimi-1.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2020/02/sql-serverda-case-when-exists-kullanimi-1-315x193.jpg 315w, https://sqlserveregitimleri.com/wp-content/uploads/2020/02/sql-serverda-case-when-exists-kullanimi-1-490x300.jpg 490w, https://sqlserveregitimleri.com/wp-content/uploads/2020/02/sql-serverda-case-when-exists-kullanimi-1-220x135.jpg 220w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere case when ile exists komutları beraber kullanılmış oldu.</p>
<p>Herkese çalışma hayatında ve yaşamında başarılar kolaylıklar.</p>
<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 1.531</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
