{"id":1859,"date":"2015-01-09T10:21:42","date_gmt":"2015-01-09T08:21:42","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=1859"},"modified":"2015-01-09T10:21:42","modified_gmt":"2015-01-09T08:21:42","slug":"sql-fejtoro-3-megoldasok","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2015\/01\/09\/sql-fejtoro-3-megoldasok\/","title":{"rendered":"SQL fejt\u00f6r\u0151 3. megold\u00e1sok"},"content":{"rendered":"<p>Az el\u0151z\u0151 <a href=\"http:\/\/soci.hu\/blog\/index.php\/2015\/01\/07\/sql-fejtoro-3-2\">fejt\u00f6r\u0151ben<\/a> ez volt a k\u00e9rd\u00e9s:<br \/>\n&#8220;Hogyan biztos\u00edtan\u00e1d egy SQL Server t\u00e1bl\u00e1ban, hogy egy oszlop csak egyedi \u00e9rt\u00e9keket tartalmazzon, de NULL-b\u00f3l b\u00e1rmennyi lehessen benne?&#8221;<\/p>\n<p>A unique contranint vagy index alapban nem engedi meg a duplik\u00e1lt nullokat, de SQL Server 2008-t\u00f3l van filtered index, ami seg\u00edts\u00e9g\u00e9vel egy where felt\u00e9telt lehet megfogalmazni az indexelend\u0151 adatokra. Ezzel m\u00e1r passzol a unique index a feladatra.<\/p>\n<p>[soruce lang=&#8217;sql]<br \/>\nCREATE UNIQUE INDEX IX_Oszlop1 ON AlmaTabla (Oszlop1) WHERE Oszlop1 IS NOT NULL<br \/>\n[\/source]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Az el\u0151z\u0151 fejt\u00f6r\u0151ben ez volt a k\u00e9rd\u00e9s: &#8220;Hogyan biztos\u00edtan\u00e1d egy SQL Server t\u00e1bl\u00e1ban, hogy egy oszlop csak egyedi \u00e9rt\u00e9keket tartalmazzon, de NULL-b\u00f3l&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4],"tags":[],"class_list":["post-1859","post","type-post","status-publish","format-standard","hentry","category-adatbazisok","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1859"}],"version-history":[{"count":1,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1859\/revisions"}],"predecessor-version":[{"id":1860,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1859\/revisions\/1860"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}