問題タブ [patindex]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
sql - 文字列から複数の「,」位置を取得する SQL クエリ
以下のような5行のデータがあります
ここで、入力文字列からすべての「,」の位置を見つける必要があります。
私の出力は次のようになります。
sql - 文字列を検索して数値のみを返す方法は?
数式列を作成する必要があります。この列では、数値を返す必要があります。
例:
database.dbo.table1 には、長いメッセージを含む「メッセージ」という列があります。
メッセージは次のようにフォーマットされます。various words, characters, spaces <this document is> document# = 12345 <this document is>
私がする必要があるのは、メッセージを検索し、「this document is」を見つけ、これらの両方のフレーズの間でドキュメントの数値を検索し、数式列内のドキュメント # を返すことです。