c# - SQL to select rows that match a URL with wildcard -
I have a column that contains a URL containing * / profile
I am a URL ( Like) and want to select all rows in the DB that matches the URL (in this case * is wildcard)
I replace it with * regex for any character, do this Was thinking about using Regex but what should be the SQL or LINQ code for selection, it's about dir The Chit.
Do you have any ideas?
As long as I'm not clarifying anything, it just needs a simple query. Your Table WHERE URL, such as 'http://example.com/users/%/'
from
SELECT * :% Character is equivalent to * wildcard in SQL expression. If you want to use LINQ and are only working against SQL Server, you can use this syntax:
var result = in YT YourTable where SqlMethods.Like (yt.URL, "http://example.com/users/%/") select YT;
Comments
Post a Comment