This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| namespace ConsoleApp1 | |
| { | |
| class CalcSumOfOddNumberFrom1to100 | |
| { | |
| static void Main(string[] args) | |
| { | |
| var sum = Enumerable.Range(1, 100).Where(x => x % 2 == 0).Sum(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 文字化け防止 | |
| chcp 65001 | Out-Null | |
| $Env:NLS_LANG = "Japanese_Japan.UTF8" | |
| [console]::OutputEncoding = [System.Text.Encoding]::UTF8 | |
| # 取得対象のSQL | |
| $innerSql = @" | |
| SELECT LEVEL SEQ,LEVEL+1 SEQ2 | |
| FROM DUAL | |
| CONNECT BY LEVEL <= 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 文字化け防止 | |
| chcp 65001 | Out-Null | |
| [console]::OutputEncoding = [System.Text.Encoding]::UTF8 | |
| # 取得対象のSQL | |
| $innerSql = @" | |
| WITH RECURSIVE Numbers AS ( | |
| SELECT 1 AS SEQ | |
| UNION ALL | |
| SELECT SEQ + 1 FROM Numbers WHERE SEQ < 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Convert-XmlToCustomObject { | |
| param ( | |
| [Parameter(ValueFromPipeline)] [xml]$xml | |
| ) | |
| process { | |
| # すべての <row> 要素をカスタムオブジェクトに変換 | |
| $rows = $xml.resultset.row | ForEach-Object { | |
| $properties = @{} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 文字化け防止 | |
| chcp 65001 | Out-Null | |
| [console]::OutputEncoding = [System.Text.Encoding]::UTF8 | |
| # 取得対象のSQL | |
| $innerSql = @" | |
| SELECT SEQ, SEQ + 1 AS SEQ2 | |
| FROM generate_series(1,10) AS SEQ | |
| "@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 文字化け防止 | |
| chcp 65001 | Out-Null | |
| $Env:NLS_LANG = "Japanese_Japan.UTF8" | |
| [console]::OutputEncoding = [System.Text.Encoding]::UTF8 | |
| # 取得対象のSQL | |
| $innerSql = @" | |
| WITH Numbers AS ( | |
| SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS SEQ | |
| FROM (VALUES(1),(1),(1),(1),(1),(1),(1),(1),(1),(1)) AS V(N) |