Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SQL2 つの文字列を見て結果が一致するすべての文字である数式を記述しようとしています。
SQL
編集: IBM DB2 に対するクエリ 編集:APと比較したABP = AP
例:
ABP compared to ABMP = ABP MP compared to P = P AP compared to BMP = P ABP compared to AP = AP
SQL がこの問題に適しているとは思いません。実際には、文字ごとに比較できるプログラミング言語を使用できます。
使用しているデータベースは、カスタム関数を作成して目的を達成し、SQL ステートメント内から関数を呼び出せるようにするオプションである場合があります。
アップデート
IBM DB2 は、上記のように顧客関数を作成するために使用できる手続き型の拡張機能を提供していると思います。残念ながら、私は DB2 の経験がないので、これについてはお手伝いできません。次のリンクを見つけました。
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/c0011916.htm