Linked Questions

2
votes
3answers
2k views

SQL - Convert text to a list of numeric values [duplicate]

Looking for SQL code to transform the text string '12,13,14' to this list of numbers +----+ | 12 | +----+ | 13 | +----+ | 14 | +----+ Example: table0.params (varchar) field contains this text: 12,...
-4
votes
1answer
1k views

Split hyphenated nvarchar value [duplicate]

I have a table with 6 columns one of which is a NVARCHAR (65) datatype. All of the entries in this table have the format XXXXX-nnnnnn. I want to be able to use the '-' as a delimiter and construct a ...
-7
votes
1answer
116 views

Split after comma into separate row [duplicate]

id name books 1 dan history,physics,english 2 ron chem,social,biology 3 mon it,ece,eee I need an output as id name books 1 dan history 1 dan physics 1 dan english 2 ron chem 2 ron ...
0
votes
0answers
45 views

How to Split string into multiple values using best approach [duplicate]

We are trying to save result of a query in database by tokenizing a column but query is taking more than 3 minutes to finish his objective. My question is, do we have any faster way to tokenize a ...
1
vote
1answer
40 views

SQL server - parsing element of delemiated string [duplicate]

I have delimited string like this 'test1:test2:test3:test4:test5'. I need to get the third and forth values one value at a time. The string always has five values.
3
votes
3answers
16k views

Excluding particular words from a string on a WHERE clause

I have a table that stores invoices and I'm trying to get stats out of it, unfortunately the table is poorly build and some crucial information is all mixed up on a nvarchar field, information such as ...
3
votes
2answers
18k views

How to separate name string by the spaces in the name in T-SQL

I have a list of names, such as: Doe John James, Doe Jane and Doe Henry Albert Sr I need to split those out into the four component parts of the name (if the name has four parts) to put each of them ...
0
votes
1answer
6k views

What is the correct SQL for using where ID in List and the items are with AND operator

I need a SQL Statement to use IN operator within the items with "And" connected. SELECT * from tbl_Users WHERE id in [1,2,3] is equivalent to: SELECT * from tbl_Users WHERE (id=1) or (id = 2) or (...
1
vote
2answers
1k views

Dealing with data stored as arrays in a MySQL DB

So I know storing arrays in a DB field is wrong and would never do it myself, however a 3rd party plugin my company is using stores data in an array and I was wondering if you could help me try to ...
1
vote
1answer
687 views

Get all the data between Characters [closed]

I am trying to extract all the variable from the following string; string = 'factor1|factor2|factor3' This is just a test string. In real string, I do not know the number of factors. What I want is ...
0
votes
1answer
67 views

Select All Instances of Substring in a String

I have a varchar(max) column that holds a JSON request string. I need a SQL statement for a report that will select all of the instances of that substring. More specifically I need to grab the LoanId ...