contains

Is there and alternative to LIKE statement in T-SQL?

怎甘沉沦 提交于 2019-12-11 02:31:42
问题 I have a scenario where I need to perform following operation: SELECT * FROM [dbo].[MyTable] WHERE [Url] LIKE '%<some url>%'; I have to use two % (wildcard characters) at the beginning and the end of Url ( '%<some url>%' ) as user should be able to search the complete url even if he types partial text. For example, if url is http://www.google.co.in and user types "goo", then the url must appear in search results. LIKE operator is causing performance issues. I need an alternative so that I can

SSRS Reporting Services - Bold Word in String

血红的双手。 提交于 2019-12-10 20:45:17
问题 Publication - How to bold author name from within a string? It would be something like this if 1 value was returned but it is a string (=iif(Fields!Author.Value = Parameters!5aAuthor.Value, "Bold", "Normal"). Example: Authors + Year + Title + Journal + PMCID . Authors = Miter, MH, Owens, R, Thompson etc… I only want to bold the Author that matches the parameter value. I need to break apart the string – find the author – bold it – and leave the others as default. Like an array…. Problems:

Using JOIN statement with CONTAINS function

微笑、不失礼 提交于 2019-12-10 18:16:27
问题 In SQL Server database I have a View with a lot of INNER JOINs statements. The last join uses LIKE predicate and that's why it's working too slowly. The query looks like : SELECT * FROM A INNER JOIN B ON A.ID = B.ID INNER JOIN C ON C.ID1 = B.ID1 INNER JOIN ........................... X ON X.Name LIKE '%' + W.Name + '%' AND LIKE '%' + W.Name2 + '%' AND LIKE '%' + W.Name3 + '%' I want to use CONTAINS instead of LIKE as : SELECT * FROM A INNER JOIN B ON A.ID = B.ID INNER JOIN C ON C.ID1 = B.ID1

How do I make contains case-insensitive in ef core 2?

别来无恙 提交于 2019-12-10 17:26:42
问题 I am trying to filter a list by a searchstring. It says in the doc on the blue note that: IQueryable gives you the database provider implementation of Contains. IEnumarable gives you the .NET Framework implementation of Contains The default setting of SQL-server instances is case-insensitive. Using "ToUpper" to make an explicit case-insensitive call should be avoided because it has a performance penalty. My filtering is as follows: IQueryable<ApplicationUser> customers = from u in _context

Local sequence cannot be used in LINQ to SQL implementation

梦想与她 提交于 2019-12-10 16:48:05
问题 I'm getting an error, see below, when I try to generate a list of the class MappedItem. In short the code example below tries to find products by category, date range and SKU. The requirement I have is that the user should be able to enter a comma separated list of SKUs and the search is to find any product whos SKU starts with one of the SKUs entered by the user. When I run the code, I get. Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains()

jQuery.contains() does not work properly

爷,独闯天下 提交于 2019-12-10 16:01:19
问题 I should get an "alert" in the following case, but I am not getting any "alert". I am trying a simple example of jQuery.Contains() . <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function() { var alpha = $.contains('body','p') { alert(alpha); }); </script> </head> <body> <p>This is a paragraph.</p> </body> </html> 回答1: As per the jQuery documentation the API takes only element nodes (not JavaScript/jQuery

How to do CSS attribute selector with title~= that has to contain a space? [duplicate]

白昼怎懂夜的黑 提交于 2019-12-10 15:54:29
问题 This question already has an answer here : CSS attribute selector does not work a href (1 answer) Closed last year . I have the following selector: .post-link[title~=Corporate] Now I need, instead, to select only elements whose title have the word "Corporate" only at the very beginning, not somewhere else in the title. So I have two alternatives: 1) create a selector that only checkes at the very beginning of the title and then skip others eventually following or 2) create a selector which

How to replace multiple if-else statements to optimize code?

丶灬走出姿态 提交于 2019-12-10 15:53:09
问题 I want to know if there is any way i could optimize this code. String[] array; for(String s:array){ if(s.contains("one")) //call first function else if(s.contains("two")) //call second function ...and so on } The string is basically lines I am reading from a file.So there can be many number of lines.And I have to look for specific keywords in those lines and call the corresponding function. 回答1: This wont stop you code from doing many String#contains calls, however, it will avoid the if/else

How to check if string is contained in an array in AutoHotKey

瘦欲@ 提交于 2019-12-10 14:23:08
问题 I have following code: ignored := [ "Rainmeter.exe", "Nimi Places.exe", "mumble.exe" ] a := ignored.HasKey("mumble.exe") MsgBox,,, %a% It returns 0 even though the string is clearly present in the array. How do I test if a string value is present in an array? PS: I also tried if var in which gives same results. 回答1: You can't, using just one command. Such functionality is not implemented in AHK_L as of 1.1.22.3. You'll have to either define your own function hasValue(haystack, needle) { if(

jquery - find element that only has text and not any other html tag

假如想象 提交于 2019-12-10 13:09:49
问题 I need to check with jquery that a anchor element only has text in it and not any other tag (img, b) or any thing else. <a href="">TV</a> Should be found, but : <a href=""><img /></a> or: <a href=""><span>TV</span></a> or any other HTML tag, shouldn't be found. How do i do this? Thanks in advance. 回答1: We can use the filter() function to remove elements which have children (checked using the children() method). var emptyAs = $('a').filter(function () { return $(this).children().length == 0; }