{"id":201,"date":"2014-02-06T18:04:46","date_gmt":"2014-02-06T09:04:46","guid":{"rendered":"http:\/\/gomocool.net\/gomokulog\/?p=201"},"modified":"2014-02-06T18:04:46","modified_gmt":"2014-02-06T09:04:46","slug":"sqlserver-sql%e3%81%ae%e5%89%b2%e3%82%8a%e7%ae%97%e9%99%a4%e7%ae%97%e3%81%ab%e6%b3%a8%e6%84%8f","status":"publish","type":"post","link":"https:\/\/gomokulog.gomocool.net\/?p=201","title":{"rendered":"[SQLServer] SQL\u306e\u5272\u308a\u7b97(\u9664\u7b97)\u306b\u6ce8\u610f"},"content":{"rendered":"<p>SQL\u3067\u5272\u308a\u7b97(\u9664\u7b97)\u3092\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n<p>\u6d88\u8cbb\u7a0e\u3060\u3063\u305f\u308a\u3001\u5229\u76ca\u7387\u3060\u3063\u305f\u308a\u3001\u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u306a\u3082\u306e\u304b\u3089\u5024\u3092\u51fa\u3057\u305f\u3044\u3068\u304d\u306f\u591a\u3005\u3042\u308b\u3002<\/p>\n<p>\u6d88\u8cbb\u7a0e\u3060\u3063\u305f\u3089\u3001\u3000\u539f\u4fa1 \u00d7 ( \u6d88\u8cbb\u7a0e\u7387 \/ 100) \u3067\u3001\u6d88\u8cbb\u7a0e\u3092\u51fa\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u4f55\u3082\u8003\u3048\u305a\u306b\u3053\u306e\u8a08\u7b97\u5f0f\u3092\u5b9f\u884c\u3057\u3066\u3044\u305f\u3089\u554f\u984c\u3060\u3063\u305f\u3002<\/p>\n<p>\u5f53\u305f\u308a\u524d\u306a\u306e\u3060\u304c\u3001\u6d88\u8cbb\u7a0e\u7387\u306b\u8a72\u5f53\u3059\u308b\u90e8\u5206\u304c\u3001\u6574\u6570\u578b\u306e\u5834\u5408\u3001100%\u672a\u6e80\u306e\u5834\u5408\u306f\u5fc5\u305a0\u306b\u306a\u308b\u3002<br \/>\n\u306a\u306e\u3067\u3001\u307b\u307c\u6d88\u8cbb\u7a0e\u304c0\u3068\u306a\u308b\u3002<br \/>\n\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u66f8\u304f\u3068\u304d\u306f\u4f55\u3068\u306a\u304f\u30ad\u30e3\u30b9\u30c8\u3092\u3057\u3066\u3044\u308b\u304c\u3001SQL \u306b\u306a\u308b\u3068\u5fd8\u308c\u3066\u3044\u305f\u3002<\/p>\n<pre class=\"lang:tsql decode:true \">DECLARE @intPer INT\r\nSET @intPer = 8\r\n\r\nSELECT 1000 * (@intPer\/100) ,@intPer\/100 ;\r\n-- 0 0\r\n\r\nSELECT 1000 * @intPer \/ 100 ,@intPer\/100 ;\r\n-- 80 0\r\n\r\nSELECT 1000 * CAST((@intPer\/100) AS NUMERIC) ,@intPer\/100 ;\r\n-- 0 0\r\n\r\nSELECT 1000 * ( CAST(@intPer AS NUMERIC)\/100) ,@intPer\/100 ;\r\n-- 80.0000000 0\r\n\r\nSELECT 1000 * ( CAST(@intPer AS FLOAT)\/100) ,@intPer\/100 ;\r\n-- 80 0<\/pre>\n<p>SQL\u3082\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u540c\u3058\u304f\u30ad\u30e3\u30b9\u30c8\u304c\u5fc5\u8981\u3002<br \/>\n\u3082\u3061\u308d\u3093\u3001\u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u3092\u5165\u308c\u308b\u5909\u6570\u304c\u3001\u3082\u3068\u3082\u3068\u5c0f\u6570\u70b9\u578b\u3067\u3042\u308c\u3070\u554f\u984c\u306a\u3044\u3002<br \/>\n\u3057\u304b\u3057\u3001\u305d\u306e\u5834\u5408\u306f\u51fa\u529b\u3055\u308c\u308b\u5024\u304c\u5c0f\u6570\u70b9\u3092\u542b\u3080\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002<\/p>\n<p>\u4eca\u56de\u306e\u5834\u5408\u30011\u5186\u4ee5\u4e0b\u306e\u5c0f\u6570\u70b9\u306f\u5207\u308a\u6368\u3066\u3060\u3063\u305f\u306e\u3067\u3001\u5148\u306b\u4e57\u7b97\u3057\u305f\u5f8c\u3001100\u3067\u9664\u7b97\u3059\u308b\u65b9\u6cd5\u3092\u9078\u3093\u3060\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u304c0\u306e\u5834\u5408\u306f\u3001\u9664\u7b97\u3059\u308b\u3068\u3059\u3079\u30660\u3068\u306a\u3063\u305f\u3002<br \/>\n0\u306f\u4f55\u3067\u5272\u3063\u3066\u30820\u3068\u3044\u3046\u4ed5\u69d8\u306e\u3088\u3046\u3060\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL\u3067\u5272\u308a\u7b97(\u9664\u7b97)\u3092\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002 \u6d88\u8cbb\u7a0e\u3060\u3063\u305f\u308a\u3001\u5229\u76ca\u7387\u3060\u3063\u305f\u308a\u3001\u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u306a\u3082\u306e\u304b\u3089\u5024\u3092\u51fa\u3057\u305f\u3044\u3068\u304d\u306f\u591a\u3005\u3042\u308b\u3002 \u6d88\u8cbb\u7a0e\u3060\u3063\u305f\u3089\u3001\u3000\u539f\u4fa1 \u00d7 ( \u6d88\u8cbb\u7a0e\u7387 \/ 100) \u3067\u3001\u6d88\u8cbb\u7a0e\u3092\u51fa\u3059\u3002 \u3057\u304b\u3057\u3001\u4f55\u3082\u8003\u3048&hellip;  <a href=\"https:\/\/gomokulog.gomocool.net\/?p=201\" class=\"more-link\">more <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,32],"tags":[65,23],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-sql","category-sqlserver","tag-sql","tag-sql-server"],"_links":{"self":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=201"}],"version-history":[{"count":2,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/201\/revisions"}],"predecessor-version":[{"id":203,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/201\/revisions\/203"}],"wp:attachment":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}