{"id":139,"date":"2020-09-03T10:52:12","date_gmt":"2020-09-03T02:52:12","guid":{"rendered":"http:\/\/www.dxQerp.com\/?p=139"},"modified":"2024-02-03T07:43:30","modified_gmt":"2024-02-02T23:43:30","slug":"%e6%9f%90%e6%8e%a8%e7%90%86%e9%a1%8c%e7%9a%84sql%e5%90%91%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/www.dxQerp.com\/?p=139","title":{"rendered":"\u67d0\u63a8\u7406\u984c\u7684SQL\u5411\u89e3"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>DECLARE @i numeric(10,0)\nset @i = 2311111111  --2313134121\nwhile @i&lt;=4444444444\nbegin\n\tif PATINDEX('%&#91;05-9]%', str(@i))=0   --ABCD\u56db\u500b\u7b54\u6848\n\n\tif SUBSTRing(str(@i),9,1) =1 and (SUBSTRing(str(@i),1,1) = SUBSTRing(str(@i),6,1) or SUBSTRing(str(@i),6,1) = SUBSTRing(str(@i),5,1))  or\n\t   SUBSTRing(str(@i),9,1) =2 and (SUBSTRing(str(@i),1,1) = SUBSTRing(str(@i),6,1) or SUBSTRing(str(@i),10,1) = SUBSTRing(str(@i),5,1)) or\n\t   SUBSTRing(str(@i),9,1) =3 and (SUBSTRing(str(@i),1,1) = SUBSTRing(str(@i),6,1) or SUBSTRing(str(@i),2,1) = SUBSTRing(str(@i),5,1))  or\n\t   SUBSTRing(str(@i),9,1) =4 and (SUBSTRing(str(@i),1,1) = SUBSTRing(str(@i),6,1) or SUBSTRing(str(@i),9,1) = SUBSTRing(str(@i),5,1))  \n\t   --\u9019\u662f\u7b2c9\u984c\n\n\tif SUBSTRing(str(@i),2,1)=1 and SUBSTRing(str(@i),5,1)=3 or \n\t   SUBSTRing(str(@i),2,1)=2 and SUBSTRing(str(@i),5,1)=4 or \n\t   SUBSTRing(str(@i),2,1)=3 and SUBSTRing(str(@i),5,1)=1 or \n\t   SUBSTRing(str(@i),2,1)=4 and SUBSTRing(str(@i),5,1)=2 \n\t   --\u9019\u662f\u7b2c2\u984c\n\n\tif SUBSTRing(str(@i),5,1) = 1 and  SUBSTRing(str(@i),8,1) = 1  or \n\t   SUBSTRing(str(@i),5,1) = 2 and  SUBSTRing(str(@i),4,1) = 2  or\n\t   SUBSTRing(str(@i),5,1) = 3 and  SUBSTRing(str(@i),9,1) = 3  or \n\t   SUBSTRing(str(@i),5,1) = 4 and  SUBSTRing(str(@i),7,1) = 4\n\t   --\u9019\u662f\u7b2c5\u984c\n\n\tif SUBSTRing(str(@i),6,1) =1 and  SUBSTRing(str(@i),2,1) = SUBSTRing(str(@i),8,1) and  SUBSTRing(str(@i),4,1) = SUBSTRing(str(@i),8,1) or\n\t   SUBSTRing(str(@i),6,1) =2 and  SUBSTRing(str(@i),1,1) = SUBSTRing(str(@i),8,1) and  SUBSTRing(str(@i),6,1) = SUBSTRing(str(@i),8,1) or \n\t   SUBSTRing(str(@i),6,1) =3 and  SUBSTRing(str(@i),3,1) = SUBSTRing(str(@i),8,1) and  SUBSTRing(str(@i),10,1)= SUBSTRing(str(@i),8,1) or \n\t   SUBSTRing(str(@i),6,1) =4 and  SUBSTRing(str(@i),5,1) = SUBSTRing(str(@i),8,1) and  SUBSTRing(str(@i),9,1) = SUBSTRing(str(@i),8,1) \n\t   --\u9019\u662f\u7b2c6\u984c\n\t\n\tif SUBSTRing(str(@i),4,1) =1 and SUBSTRing(str(@i),1,1) = SUBSTRing(str(@i),5,1)  or\n\t   SUBSTRing(str(@i),4,1) =2 and SUBSTRing(str(@i),2,1) = SUBSTRing(str(@i),7,1)  or\n\t   SUBSTRing(str(@i),4,1) =3 and SUBSTRing(str(@i),1,1) = SUBSTRing(str(@i),9,1)  or\n\t   SUBSTRing(str(@i),4,1) =4 and SUBSTRing(str(@i),6,1) = SUBSTRing(str(@i),10,1)  \n\t   --\u9019\u662f\u7b2c4\u984c\n\n\tif SUBSTRing(str(@i),3,1) =1 and SUBSTRing(str(@i),6,1) &lt;>1 and  SUBSTRing(str(@i),2,1) &lt;>1 and  SUBSTRing(str(@i),4,1) &lt;>1 or \n\t   SUBSTRing(str(@i),3,1) =2 and SUBSTRing(str(@i),6,1) &lt;>2 and  SUBSTRing(str(@i),2,1) &lt;> SUBSTRing(str(@i),6,1) and  SUBSTRing(str(@i),4,1) &lt;>SUBSTRing(str(@i),6,1) or\n\t   SUBSTRing(str(@i),3,1) =3 and SUBSTRing(str(@i),6,1) &lt;>SUBSTRing(str(@i),2,1)  and  SUBSTRing(str(@i),2,1) &lt;>3 and  SUBSTRing(str(@i),4,1) &lt;>SUBSTRing(str(@i),2,1) or\n\t   SUBSTRing(str(@i),3,1) =4 and SUBSTRing(str(@i),6,1) &lt;>SUBSTRing(str(@i),4,1) and  SUBSTRing(str(@i),2,1) &lt;>SUBSTRing(str(@i),4,1) and  SUBSTRing(str(@i),4,1) &lt;>4\n\t   --\u9019\u662f\u7b2c3\u984c\n\n\tif SUBSTRing(str(@i),8,1) =1 and abs(cast(SUBSTRing(str(@i),7 ,1) as int)-cast(SUBSTRing(str(@i),1,1) as int))>1 or\n\t   SUBSTRing(str(@i),8,1) =2 and abs(cast(SUBSTRing(str(@i),5 ,1) as int)-cast(SUBSTRing(str(@i),1,1) as int))>1 or\n\t   SUBSTRing(str(@i),8,1) =3 and abs(cast(SUBSTRing(str(@i),2 ,1) as int)-cast(SUBSTRing(str(@i),1,1) as int))>1 or\n\t   SUBSTRing(str(@i),8,1) =4 and abs(cast(SUBSTRing(str(@i),10,1) as int)-cast(SUBSTRing(str(@i),1,1) as int))>1 \n\t   --\u9019\u662f\u7b2c8\u984c\n\t   print '\u6b63\u78ba\u7b54\u6848\u6709:'+str(@i)\n\t\t\t\nset @i =@i+1\n\nend<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":243,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[25,1],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ms-sql","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.dxQerp.com\/wp-content\/uploads\/2020\/09\/jztqvxcykys-scaled.jpg?fit=2560%2C1707","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=139"}],"version-history":[{"count":7,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":514,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions\/514"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/media\/243"}],"wp:attachment":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}