テーブルにエントリがあります
12-345678
123-456-789
123456789
UIテキストボックスで、誰かが次のように入力した場合: - (two spaces then one dash).
出力は次のようになります。
12-345678
UIテキストボックスで、誰かが次のように入力した場合:12-
出力は次のようになります。
12-345678
UIテキストボックスで、誰かが次のように入力した場合:12
12-345678
123-456-789
123456789
これを行うための私の選択クエリは
select column1,column2 from table1 where column1 like '%textbox1.text%';
textbox1.text->UIのテキストボックス名。
前のすべて-例:返される必要があります:
if you type 12-, return output should be 12-345678 alone,
if you type 123-, then the return output should be 123-456-789 alone.
if you type - (only dash, no space on the front , then the return output should be 12-345678 and 123-456-789 .
ただし、いくつかの条件で失敗します。スペースを計算し、SQLでクエリを直接変更する方法はありますか?