I have this table in SQL Server 2012:
Id INT DomainName NVARCHAR(150)
And the table have these DomainName values
And this value:
mail.othersite.com
and I need to select the rows where the string ends with the column value, for this value I need to get the row no.3 othersite.com
It's something like this:
DomainName Like '%value'
but in reverse ...
'value' Like %DomainName
The SQL LIKE Operator There are two wildcards often used in conjunction with the LIKE operator: The percent sign (%) represents zero, one, or multiple characters.
You can use such query:
SELECT * FROM TABLE1 WHERE 'value' LIKE '%' + DomainName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With