﻿
{"id":5718,"date":"2017-03-01T16:39:05","date_gmt":"2017-03-01T16:39:05","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=5718"},"modified":"2017-03-01T16:39:05","modified_gmt":"2017-03-01T16:39:05","slug":"t-sql-select-sorgusunda-istenilen-siradaki-satiri-elde-etme","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/t-sql-select-sorgusunda-istenilen-siradaki-satiri-elde-etme\/","title":{"rendered":"T-SQL &#8211; Select Sorgusunda \u0130stenilen S\u0131radaki Sat\u0131r\u0131 Elde Etme"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>\u015eimdi T-SQL&#8217;de select sorgusu neticesinde elde edilen tablonun istenilen s\u0131radaki sat\u0131r\u0131n\u0131 elde etmeyi g\u00f6rece\u011fiz. Tabi bu i\u015flemi yaparken elimizdeki tablonun Id yahut tekil bir kolonundaki de\u011fere g\u00f6re bir \u015fart uygulayarak de\u011fil direkt olarak eldeki tablonun \u00fcstten s\u0131ralamas\u0131 baz al\u0131narak istenilen sat\u0131r elde edilecektir.<\/p>\n<p><a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme.png\" alt=\"T-SQL - Select Sorgusunda \u0130stenilen S\u0131radaki Sat\u0131r\u0131 Elde Etme\" width=\"361\" height=\"256\" class=\"aligncenter size-full wp-image-5719\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme.png 361w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme-300x213.png 300w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/a><\/p>\n<p>\u00d6rnek olarak yukar\u0131daki sorgu neticesinde gelen tablonun 5. sat\u0131r\u0131ndaki veriyi elde edelim. Bu i\u015flemi \u015fu \u015fekilde bir yakla\u015f\u0131m sergileyerek yapaca\u011f\u0131z. <a target=\"_blank\" href=\"http:\/\/www.gencayyildiz.com\/blog\/transact-sql-row_number-fonksiyonu\/\">ROW_NUMBER<\/a> fonksiyonu ile elde etti\u011fimiz tabloya bir indexer kolonu ekleyece\u011fiz. Haliyle bu kolon arac\u0131l\u0131\u011f\u0131yla ilgili tablonun PersonelID kolonuna ait bir say\u0131sal numaraland\u0131rma ger\u00e7ekle\u015ftirmi\u015f oluyoruz. \u0130\u015fte bu sorguyu SubQuery olarak kullan\u0131p d\u0131\u015ftaki sorgu sonucunda bu indexera \u015fart ekleyece\u011fiz. Ee haliyle bu \u015fartta verilen herhangi bir numerik de\u011fer ilgili tabloda yukar\u0131dan a\u015fa\u011f\u0131 s\u0131ralamada sat\u0131r numaras\u0131na denk gelecektir.<\/p>\n<p>T\u0131pk\u0131 a\u015fa\u011f\u0131da oldu\u011fu gibi;<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme-1.png\" alt=\"T-SQL - Select Sorgusunda \u0130stenilen S\u0131radaki Sat\u0131r\u0131 Elde Etme.PNG\" width=\"518\" height=\"154\" class=\"aligncenter size-full wp-image-5725\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme-1.png 518w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/03\/T-SQL-Select-Sorgusunda-\u0130stenilen-S\u0131radaki-Sat\u0131r\u0131-Elde-Etme-1-300x89.png 300w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/a><\/p>\n<p>G\u00f6r\u00fcld\u00fc\u011f\u00fc gibi \u015fartta verilen de\u011fer tablodaki sat\u0131r numaras\u0131na tekab\u00fcl etmekte ve ilgili sat\u0131r\u0131 bize getirmektedir.<\/p>\n<p>Sonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, \u015eimdi T-SQL&#8217;de select sorgusu neticesinde elde edilen tablonun istenilen s\u0131radaki sat\u0131r\u0131n\u0131 elde etmeyi g\u00f6rece\u011fiz. Tabi bu i\u015flemi yaparken elimizdeki tablonun Id yahut tekil bir kolonundaki de\u011fere g\u00f6re bir \u015fart uygulayarak de\u011fil direkt olarak&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":3415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[1618,75,266,245,461],"class_list":["post-5718","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-veritabani","tag-row_number","tag-select","tag-sql","tag-sql-server","tag-t-sql"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/5718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=5718"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/5718\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/3415"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=5718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=5718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=5718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}