Questions tagged [string-searching]

For questions about searching a string for matches

Filter by
Sorted by
Tagged with
137 votes
8 answers

Pattern matching with LIKE, SIMILAR TO or regular expressions in PostgreSQL

I had to write a simple query where I go looking for people's name that start with a B or a D : SELECT FROM spelers s WHERE LIKE 'B%' OR LIKE 'D%' ORDER BY 1 I was wondering ...
20 votes
3 answers

What is it called when you search the middle of a string instead of the beginning?

I am trying to polish up my vocabulary to better communicate with my fellow developers. We have several places in the site where we are debating if we should search for a string from the beginning '...
4 votes
1 answer

Find records with same string with extra character

OK, so I have a Microsoft SQL Server 2014 database table called owner with around 90,000 records with owner information, another called vehicle with vehicle information Owner_Name ...
0 votes
1 answer

why my split string functions are not working with large OBJECT_DEFINITION?

I have in one of my databases a stored procedure called PROCEDURE [repl].[usp_upd_repl_out_application], that is not exactly a very clever stored procedure but it has over 389 lines. As I need to ...
13 votes
4 answers

Find if any of the rows partially match a string

I want to see if a table contains any sub-string of a given string. Let's say I have a string In database I have: I need to make a ...
  • 263
13 votes
7 answers

How to find all positions of a string within another string

How can I find all the positions with patindex in a table or variable? declare @name nvarchar(max) set @name ='ali reza dar yek shabe barani ba yek ' + 'dokhtare khoshkel be disco raft va ali ...
  • 1,032
5 votes
1 answer

Match .csv values as INTs. If one value from a group in the .csv matches one in another group, then merge strings

Here we have two sets of numbers. The problem is that I can't figure out how to get from the input to the output of numbers (DDL and DML below and also in the fiddle here). current_data 1,2,3 1,4 1,5,...
2 votes
1 answer

Search entire database(210 tables) for a unique Id (PK) and get the table name

Rewritten Question: I need to look through an entire database, 210 tables for a unique ID that is a number. I have limited access to my database through things called nodes (Visual programming.) ...
  • 23
2 votes
1 answer

Search on concatenate columns

I have this : CREATE TABLE users ( first_name varchar(60) NOT NULL, last_name varchar(60) NOT NULL ); INSERT INTO users (first_name, last_name) VALUES ('Sylvia ', 'Hoeks'), ('...
  • 587
2 votes
2 answers

Return results that contain or do not contain punctuation

Is there a way within MySQL to return results using a LIKE statement that contain or do not contain punctuation characters such as apostrophes and hyphens? For example if I have one of the following ...
2 votes
3 answers

Using fulltext search to find a sequence of digits

We have a column of ten digit numbers (with leading zeros). We are trying to find rows that have a specific sequence of digits. For example, all rows containing "5088" in any place in the column. ...