Reputation: 23
I have a table that, among its columns, has two particular char columns: "Code" and "Obs".
For example:
Column1 | Code | Obs |
---|---|---|
aaa | 123 | This customer's code is 123 |
How do I find this record, based on the fact that the info on column "Code" is present in the info on column "Obs"?
Upvotes: 1
Views: 150
Reputation: 23
Is there a reason this is happening?
SELECT num1, num2, CHARINDEX(num1, num2) as charindex
FROM mytable
Num1 | Num2 | charindex |
---|---|---|
3456 | 123-456 | 0 |
3579 | 135790 | 0 |
35 | 35 | 1 |
35 | 351 | 0 |
Upvotes: 0