Questions tagged [sql-like]
The LIKE predicate is used to search for a specific pattern in a column.
3,178
questions
-4
votes
0
answers
51
views
Using LIKE Operator for column name [closed]
Table1 has two columns of NVARCHAR and DECIMAL.
Table2 has one column of NVARCHAR.
Table1 has values of (Ringo;100), (Ringo;200)
Table2 has values of (_ingo), (Dango)
May I use the LIKE operator for ...
0
votes
1
answer
35
views
In BigQuery, how to clusterize Stackoverflow tags?
I'm trying to clusterize the Stackoverflow tags from the BigQuery public dataset.
According to one of my data specialists colleagues, the standard procedure is to link each tag to the "nearest&...
0
votes
1
answer
25
views
PervasiveSQL CONCAT not working in LIKE statement
I'm trying to build a dynamic LIKE statement, where the last 2 digits of the current year is passed into the LIKE part.
SELECT
COUNT(*) AS amount
FROM "ALLE" AS v
WHERE
(v.VMT != '' AND
v....
1
vote
0
answers
33
views
How to highlight the search keyword (inject html code) directly in the SQL results using prepared statements?
Edit : my question is not a duplicate of how to highlight search results since i am trying to work with the query and not the query results. I know i could work with the query result and i even tried, ...
1
vote
1
answer
34
views
Mysql : Select query with like
I have this kind of data in my database "mydb" :
id | name
---------
1 | abcdef
2 | bcdefg
3 | cdefgh
4 | defghi
5 | efghij
I do a simple SELECT query like this one :
SELECT * FROM ...
1
vote
1
answer
24
views
CHECK constraint matching beginning of value
We are using sqlite3 for a database and ensuring values inserted into a column matching a specific string would be useful in our case.
Example:
CREATE TABLE people ("firstname" TEXT),
CHECK(...
1
vote
1
answer
58
views
slow live search on the page (MySQL InnoDB)
There is a live search on my page. When sending a request to the server, filtering and sorting parameters are accepted (developer, publisher, genre, time, etc.). The problem is that its execution ...
1
vote
2
answers
36
views
How to check which specific value occurs in a like statement in BigQuery?
I have a question about like statements and BigQuery. I think maybe what I have in mind is not achievable, but I'm not 100% sure.
I have a query that checks different jobs I have in my working ...
2
votes
1
answer
33
views
How to query on multiple columns with IN and partial string matching
Let's say I have a table like:
col1 | col2 | col3|
---------------------
john | i1 | docs/name.txt
john | i1 | images/prof.jpg
marry| i2 | images/prof.jpg
I need to be able to query from the table ...
1
vote
1
answer
44
views
COLLATE Vietnamese_CI_AI is not working correctly with LIKE '%value%'
I have data in Vietnamese with accents:
Bảo Linh, Ngọc Mai
If I search with query:
select * from profile where fullname COLLATE Vietnamese_CI_AI like '%ao%'
It returns Bảo Linh
Problem is when I ...
0
votes
1
answer
49
views
Unable to Search for Specific Russian Text in SQL Server ntext Column Using LIKE Operator [duplicate]
I'm currently working on an ASP.NET Core application that uses Entity Framework Core to interact with a SQL Server database. I have a specific issue where I'm unable to search for Cyrillic text in a ...
2
votes
5
answers
94
views
Select by range of letters
Table students I am trying to sort by names for letters in range A-M:
I've tried:
SELECT * FROM student WHERE student_first_name like '[A-M]%';
It's not giving me anything.
0
votes
1
answer
45
views
How can I combine a BETWEEN condition with multiple LIKE expressions?
I'm trying provide film titles that start with the letters "S" and "T", and have a replacement cost of 15.99 to 20.99.
I try to use this code but it still returns some data lower ...
0
votes
0
answers
35
views
Using SQL Like operation for many values on many columns
I am trying to write some SQL to query a Customer Account table, I would like to populate a new column called Product as name of each product, if any of the 5 product description columns contain '...
0
votes
1
answer
39
views
Searching for exact word match in MySQL column values
I am working with a MySQL database and have a table with a column named "Tags" that contains multiple tags combined in a single string. For example, a row in the "Tags" column ...
1
vote
1
answer
56
views
SQL Server Full-Text Search Issue: Inconsistent Results Between CONTAINS and LIKE Queries with word 'za'
For the first time, I'm using full-text search. I have SQL Server 2022 Standard installed, and I've set up full-text search. I created a full-text catalog, [fullTextCatalog_CjeniciArtikli], with ...
1
vote
1
answer
51
views
SQL Server pattern matching
I am joining several different tables in SQL Server. The join is based on a loosely defined code set that has been entered slightly differently in the tables I'm joining. The same code has been ...
0
votes
2
answers
141
views
How to find entire string using typeORM, Nestjs, SQL Server, just like LIKE clause in mysql
I have database called Beta and table called Keys. In that table I have a column licenseKey: string. I want to find the entire licenseKey from the portion of licenseKey.
Just like SQL below query:
...
0
votes
0
answers
36
views
SQL Server 2019 - Issues querying where column data contains brackets "[" or "]" [duplicate]
I have two tables each containing a folder path column. These columns may contain brackets (i.e. Folder1\Folder2\Folder3[Old]\). Joining the two table columns (table1.path = table2.path) will return ...
0
votes
1
answer
22
views
Mysqli Match subquery for search factor
I'm using phalcon php V5.2.2. I want to apply a search query for my online store which can find data by product_title, keywords and specification. Noted: keywords is array. I did my query like below ...
-2
votes
1
answer
40
views
brackets wildcards not working for sqlite3?
I want to select all rows where the name mentions the word "Cheesecake" or "cheesecake".
I'm trying to run this sql log with sqlite3 but it doesn't seem to work:
SELECT * FROM food
...
0
votes
0
answers
17
views
Is it possible to do a Like Condition in firebaseDatabase with Flutter? [duplicate]
I am trying to do a query with Like condition with String in a Firebase Realtime Database, but I can't manage to do it work
I already tried .startAt and .endAt or equalsTo('%$model%'), with startAt ...
1
vote
2
answers
42
views
MySQL find multiple occurences LIKE '%pp%' AND LIKE '%p%' to NOT match "hippo"
I am trying to match keywords using multiple LIKE's, however I would like to be able to do something like this:
SELECT * FROM `keywords` WHERE keyword LIKE '%pp%' AND keyword LIKE '%p%';
to match &...
-1
votes
2
answers
53
views
SQL how to output a line with ONLY ONE "," and ONE character ";"
The query outputs lines with more than one comma, but I only need ONE comma and ONE semicolon
SELECT *
FROM table
WHERE history_coord is NULL
OR history_coord LIKE '%,%' AND history_coord LIKE '%;%'...
0
votes
2
answers
56
views
Like query for comma separated numbers
I am trying to get data from a view which returns users name and tags (comma separated numbers). Now I want to get a user if it has a certain tag.
My view returns this:
id | name | tags ...
1
vote
1
answer
30
views
UPDATE from another table using LIKE between target and source columns to match rows
I have 2 tables, tblSource and tblTarget
tblSource:
ID
Info
Born
City
1
1954 Barry Nelson TV series
US
San Francisco
2
1954 Sean Connery Dr. No
UK
Edinburgh
3
1967 David Niven Casino Royale
UK
...
0
votes
1
answer
67
views
How to not escape a character in a Django ORM?
I use Django, ORM.
I don't want the character '%' to be escaped.
name=''
author=''
annotation = 'harry%magic%school'
criterion_name = Q(name__contains=cleaned_data['name'])
criterion_author = Q(...
0
votes
3
answers
41
views
Filter records with parameters using like statement
I have a query to filter location by different regions based on postal code of that. To distinguish these regions, people must rely on the first 2 numbers of that and each region contains many ...
0
votes
1
answer
71
views
How can I implement a check constraint for attribute ID to start with specified letters?
I want my attribute ID to start with the letters AB, followed by exactly 8 integers. And how would I do it, when I want it to start and end with defined letters?
CREATE TABLE Table(
ID TEXT NOT ...
0
votes
1
answer
60
views
How to match product codes with subcodes
Price list of main products vordlusajuhinnak contains 3 prices for product (column toode) and has 39433 products:
create table vordlusajuhinnak( toode varchar(60),
n2 numeric(8,2),
n3 numeric(...
1
vote
1
answer
46
views
SQL Server Pattern -Finding records from F1AGE-F20AGE
I tried checking pattern using
SELECT *
FROM TEST
WHERE QUESTION LIKE '%F[1-9]AGE%`
trying to find F1AGE - F9AGE (which is correct).
Column A
F1AGE
F2AGE
F3AGE
F4AGE
F5AGE
F6AGE
F7AGE
...
0
votes
0
answers
15
views
like command in teradata or what to use to get all files
When I run my command below it only pulls 1 file when there should be multiple files what do I have wrong ?
select srvc_dt as Service_Date_Month,emr_pract_src_cd as Practice,SRC_MEASR_DESC as ...
0
votes
2
answers
71
views
Redshift table joins using Similar To
I have this query that runs in Redshift:
Select A.*
From TableA A
join TableB B
on A.Col like B.Pattern
Where the Pattern column in TableB looks like:
('%foo%', '%bar%', ...)
TableB has hundreds ...
1
vote
2
answers
28
views
mysql not returning records that contain substring
I have a database emails that has crewEmails which contain email addresses. I'm trying to get all addresses that contain "comcast" in the address. Here's the sql I'm using:
SELECT * FROM `...
-1
votes
1
answer
63
views
number validation with like operator in ms sql server
I have a table with values('99','-99','99.99','-99.99','99-','$99','99#','99.99.99','-99.99.99'
,'-99-99.99');
I need output like this(99,-99,99.99,-99.99);
I tried with like operator but facing ...
-2
votes
1
answer
52
views
How to filter out SQL results using Like and Not like at the same time
I've got the following text data I'd like to filter out. The column name is "content":
"Apple is my favourite fruit"
"Apple juice is delicious"
"Apple seeds are ...
0
votes
1
answer
33
views
Speed up LIKE queries without words language
I have a table with 3 columns of VARCHAR.
I want to do a query to search if an alphanumeric string is contented in these 3 columns. Such as :
LIKE '%whatever%' but speed up.
I have seen the use of ...
1
vote
1
answer
68
views
jOOQ like any, ignore case
So from https://blog.jooq.org/quantified-like-any-predicates-in-jooq-3-12/ I was expecting this to work:
private fun Condition.andProjectIn(projects: Collection<String>): Condition = when {
...
0
votes
2
answers
40
views
SQL - LIKE command using subquery returning multiple rows
I am trying to run a subquery with the same table.
Essentially I have the 1st query:
SELECT workorder
FROM pidata
WHERE equipment LIKE '%ABC%' and dataofinterest LIKE '%EFG%'
And a 2nd query:
SELECT ...
0
votes
1
answer
158
views
How to use Clickhouse Token Bloomfilters with Arrays
How can I leverage bloomfilters on array(string) in Clickhouse.
For example, I have this data structure:
create table test_schema.test_table (
partition_time DateTime64(9
,keys ...
1
vote
0
answers
13
views
SQL LIKE repeating n times not-this-charachters [^*]
We have a coding system for SKU which indicates the variants of an item.
The generic code is:
261/TEPU.x.x
The specific variants are something like:
261/TEPU.A.I
261/TEPU.Z.GS
How can I select in ...
0
votes
0
answers
31
views
How to search the encrypted data using like operator in PHP [duplicate]
Data saved in the MYSQL tables in an encrypted way cannot be searched by like operator.
We have saved it using openssl_encrypt(), it is only working with the same value.
Here is the code we are using ...
-1
votes
2
answers
46
views
SQL query for CONTAIN check and JOIN excel TABLE
Supplier
Requestor
Expected RESULTS
SQL Code :
SELECT T2."Fullname",T2."Town", T2."Age", T1."Surname"
FROM "Requestor" as T2
LEFT JOIN "Supplier&...
0
votes
1
answer
83
views
Use of like "%" character in sql query changes my query when executed as shell script
I am new to shell scripting and trying to read a list of employee IDs from a text file as part of my first shell script program and pass it to another shell script as it's an argument.
In the second ...
0
votes
2
answers
69
views
Convert SQL LIKE clause to JAVA PrepareStatement
I have a problem to convert existing code to PrepareStatement as code below.
In this case I'm using LIKE clause. My database is Oracle 19c.
public int getCountReprintHistory(String request_date, ...
0
votes
0
answers
42
views
How to exclude all items except listed one in MariaDB - two of three queries returns empty result set even the logic is same
I have set of various varchar records in a table and I need to exclude all records that starts with "Item..." except defined group of values "Item025", "Item027" and &...
1
vote
1
answer
73
views
SQL Server Search for Arabic Ya and Kaf when using LIKE Operator
I have problem in searching different types of Arabic Ya. As it is shown in the picture, I get different results.
I have tried the following collations but the result is the same:
ALTER TABLE dbo....
0
votes
2
answers
128
views
Need to select people whose name starts with "M" or the second from the end letter of the last name is "i"? The column has persons name, surname
My table in SQL has a column with persons name and surname like "Mike Baldwin", "Sara Larson" etc. and need to output all the persons whose name starts with "M" or ...
-2
votes
1
answer
38
views
how to use like function in collection
i have trouble where i need to use where like orwhere like function in collection but it didn't work
here's my query
$data = Unit::with([
// mendapatkan relasi skpd
'program....
0
votes
1
answer
231
views
Using SQL like with range operator in Databricks
In a Databricks SQL endpoint, the SQL like with range operator is not working.
Ex1:-
with Cte_Members AS
( Select '1A' as Memid
union all
Select '2B' as Memid
union all
Select '3C' as Memid
union all
...