Transactions
SQL Server テーブルに列がありますA
。
そのテーブルには約1000行あり、各行には次の組み合わせを持つ文字列があります
"@transaction --space of 3 characters---1" or "@transaction --space of 3 characters---0" these strings may be even repeated n number of times within the single row.
結果 - すべてを確認したい
"@transaction --space of 3 characters---1" ones how many times repeated.
"@transaction --space of 3 characters---0" zeros how many times repeated.
私は次のようなクエリで試しました
Select * from A where transaction like '%@transaction --space of 3 characters---1%
Select * from A where transaction like '%@transaction --space of 3 characters---0%
しかし、これらは、単一の列に上記の文字列の数が多い可能性があるため、望ましい結果を得ることができません。
1 と 0 で終わるこれら 2 つの文字列をすべて個別にカウントする方法を誰かが提案できますか?
前もって感謝します