3,268 questions
-1
votes
0
answers
98
views
Which index is useful on like clause? [duplicate]
SELECT o
FROM Order o
WHERE o.customerEmail LIKE %:emailPart%
are there any RDBMS (PostgreSQL) index type which can improve performance of the query above? (i.e. which index can help on like clause?)
1990
votes
47
answers
1.9m
views
How to query MongoDB with "like"
I want to query something with SQL's like query:
SELECT * FROM users WHERE name LIKE '%m%'
How can I achieve the same in MongoDB? I can't find an operator for like in the documentation.
628
votes
17
answers
627k
views
How to make "case-insensitive" query in Postgresql?
Is there any way to write case-insensitive queries in PostgreSQL, E.g. I want that following 3 queries return same result.
SELECT id FROM groups where name='administrator'
SELECT id FROM groups ...
460
votes
16
answers
625k
views
How can I search (case-insensitive) in a column using LIKE wildcard?
I looked around some and didn't find what I was after so here goes.
SELECT * FROM trees WHERE trees.`title` LIKE '%elm%'
This works fine, but not if the tree is named Elm or ELM etc...
How do I ...
414
votes
15
answers
465k
views
How to do SQL Like % in Linq?
I have a procedure in SQL that I am trying to turn into Linq:
SELECT O.Id, O.Name as Organization
FROM Organizations O
JOIN OrganizationsHierarchy OH ON O.Id=OH.OrganizationsId
where OH.Hierarchy ...
375
votes
16
answers
452k
views
Equals(=) vs. LIKE
When using SQL, are there any benefits of using = in a WHERE clause instead of LIKE?
Without any special operators, LIKE and = are the same, right?
337
votes
11
answers
249k
views
How can I escape square brackets in a LIKE clause?
I am trying to filter items with a stored procedure using like. The column is a varchar(15). The items I am trying to filter have square brackets in the name.
For example: WC[R]S123456.
If I do a ...
425
votes
5
answers
1.4m
views
Combining "LIKE" and "IN" for SQL Server [duplicate]
Is it possible to combine LIKE and IN in a SQL Server-Query?
So, that this query
SELECT * FROM table WHERE column LIKE IN ('Text%', 'Link%', 'Hello%', '%World%')
Finds any of these possible matches:
...
214
votes
9
answers
577k
views
SQL- Ignore case while searching for a string
I have the following data in a Table
PriceOrderShipped
PriceOrderShippedInbound
PriceOrderShippedOutbound
In SQL I need to write a query which searches for a string in a table. While searching for a ...
211
votes
9
answers
458k
views
MySQL Like multiple values
I have this MySQL query.
I have database fields with this contents
sports,shopping,pool,pc,games
shopping,pool,pc,games
sports,pub,swimming, pool, pc, games
Why does this like query does not ...
0
votes
1
answer
128
views
Use of Pipe (Vertical bar) in SQL LIKE operator statements
I am looking to combine the following two LIKE string comparisons into one LIKE string comparison:
SELECT *
FROM dbo.Departments D
WHERE D.SystemKey LIKE 'SCI%'
OR D.SystemKey LIKE 'FOO%';
I have ...
275
votes
7
answers
404k
views
Case insensitive searching in Oracle
The default behaviour of LIKE and the other comparison operators, = etc is case-sensitive.
Is it possible make them case-insensitive?
170
votes
8
answers
182k
views
PostgreSQL LIKE query performance variations
I have been seeing quite a large variation in response times regarding LIKE queries to a particular table in my database. Sometimes I will get results within 200-400 ms (very acceptable) but other ...
115
votes
16
answers
346k
views
LIKE operator in LINQ
Is there any way to compare strings in a C# LINQ expression similar to SQL's LIKE operator?
Suppose I have a string list. On this list I want to search a string. In SQL, I could write:
SELECT * FROM ...
106
votes
11
answers
154k
views
Parameter in like clause JPQL
I am trying to write a JPQL query with a like clause:
LIKE '%:code%'
I would like to have code=4 and find
455
554
646
...
I cannot pass :code = '%value%'
namedQuery.setParameter("%" + this.value + "%...