Questions tagged [like-keyword]

10 questions
11
votes
5 answers

How to use like condition with multiple values in sql server 2005?

I need to filter out records based on some text matching in nvarchar(1000) column. Table has more than 400 thousands records and growing. For now, I am using Like condition:- SELECT * FROM table_01 WHERE Text like '%A1%' OR Text…
User13839404
  • 1,803
  • 12
  • 37
  • 46
9
votes
9 answers

Like vs. "=" for matching strings using SQL Server

Whenever I write a stored procedure for selecting data based on string variable (varchar, nvarchar, char) I would have something like: procedure dbo.p_get_user_by_username( @username nvarchar(256) as begin select u.username …
kristof
  • 52,923
  • 24
  • 87
  • 110
4
votes
1 answer

Linq LIKE functionality

so.. I'm using LinqToEntities, and I want to query part of a field. Normally I'd use the LIKE keyword with SQL, and then go from there.. I see that Linq does not have it.. Whats a good way to get the same kind of functionality?
KevinDeus
  • 11,988
  • 20
  • 65
  • 97
3
votes
2 answers

Searching for newlines in a Oracle DB using SQL 'like' clause

I'm trying to see if a particular column in a table in my Oracle database has any strings which contain a newline character, so a wildcard, a newline, and another wildcard. I've tried the like command and a combination with CHR(10) and tried…
awied
  • 2,698
  • 5
  • 33
  • 37
2
votes
2 answers

Query related data based on "like" statement

I have two tables Table1: ColumnA (varchar) Table2: ColumnB (varchar) I need to get all rows from T2 where ColumnB is "like" any of the rows from 'ColumnA%'. For example, rows in T1 might be: Summer09 Fall09 while rows in T2 might be Spring09…
Jason
  • 17,276
  • 23
  • 73
  • 114
1
vote
1 answer

sql server like clause

Hey guys, I have a column in an sql server table that is nvarchar(max). I query the table with: select * from CrossArticle_Article where Summary like '%PHILADELPHIA-BASED GUITARIST AND composer Tim%' If I enter 5 words in the like clause, I get…
Abbas
  • 4,948
  • 31
  • 95
  • 161
1
vote
3 answers

Why does LIKE not return rows for variables with '%' at end?

I find this quite odd on Microsoft SQL Server: SELECT * FROM deliveries WHERE code LIKE '01999195000%' -- 9 rows returned. Works. DECLARE @a VARCHAR(10) SET @a='01999195000%' SELECT * FROM deliveries WHERE code LIKE @a -- 0 rows returned? Why…
Simon Hughes
  • 3,534
  • 3
  • 24
  • 45
0
votes
4 answers

ASP.NET Dynamic Linq Search

var query = (from u in results select u).AsQueryable(); //Build where clause if (!string.IsNullOrEmpty(userRequest.searchData)) { if (userRequest.searchBy == "LastName") { var likestr = userRequest.searchData.Trim(); …
Mark
  • 2,543
  • 6
  • 33
  • 44
0
votes
2 answers

How to query text column(s) using a Table Valued Parameter?

I have a Table Valued Parameter (@KEYWORD) which just has one column with 0 to many rows of keywords that will query against one or two database (nvarchar) columns (REMARKS and SUPPLEMENTAL_REMARKS). Super simple concept. What I am having trouble…
-1
votes
1 answer

How to use Like keyword in my sql using powershell

I have tried with the query SELECT * FROM table_a WHERE id = 1987 AND worklist LIKE "%'worklistConfig':'clientLevel'%"; It is working in my sql & powershell. but i need to execute this is procedure via powershell. i have tried with the below…
Noufal netspective
  • 101
  • 1
  • 1
  • 8