问题
I have table with two columns with this sample data:
Column1 Column2
------------------------
A B
A C
A D
R B
R D
S E
If I pass the input value of Column2='B', it will display these records:
Column1 Column2
-------------------------
A B
A C
A D
R B
R D
because Column2 'D' Contains 'A' in column1 and 'R' in Column1. So it fetches all the records which contains 'A' and 'R'
Suppose if I pass an input if Column2='C', it will display these records
Column1 Column2
-------------------------
A B
A C
A D
because Column2 'C' Contains 'A' in Column1. So it fetches all the records which contain 'A'.
Original table contains > 100k records. So we will give any input for column2.
来源:https://stackoverflow.com/questions/51289488/selecting-records-in-sql-server