All Questions
2,995
questions
1
vote
2
answers
38
views
How to trim a string by the nth occurrence of a special character?
I have string values (filed name: filename) that follow a certain template:
filename_this_is_called_Plan_A
file_this_is_Plan_A
filename2024_this_is_known_as_Plan_A
While the strings are all a ...
0
votes
1
answer
37
views
Set value in column based on multiple conditions on multiple columns
Could someone please help me on this.
Been searching for hours on several platforms, tried several solutions but can't figure out the exact code for the possible solutions. In other words: I can't get ...
-1
votes
2
answers
41
views
Cross-checking strings from 2 different columns
I have the following columns from 2 tables with customers' allergens and food recipes. I want to cross-check both columns to see which customers asked for recipes containing their allergens.
I cannot ...
0
votes
2
answers
44
views
Delimit string to search in SQL
Wondering if there is a way to delimit string to search in sql. I primarily use notepad++ to delimit string, but is there a way to accomplish this in SQL? In this example, I delimit the string with (',...
0
votes
2
answers
83
views
Replacing a part of a SQL text string via an Update statment
Im trying to update a set of strings I have with duplicate values but I only want to update the "second" set of duplicate values and not the first. This value stored in a string field in a ...
0
votes
3
answers
92
views
SQL - substrings
I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements is to remove the leading zeros (when exist) and the zeros between a suffix and the ...
0
votes
1
answer
66
views
window function for analysing a string
So when the record has the same VAR, same Group but different SalesPrice: i need to comment it as 'need to define'
i was trying to use window function but cannot succeed with it.
any help is ...
0
votes
1
answer
42
views
Retrieve the count of occurrences for each hashtag mentioned in the tweets
I have a tweets table in my PieCloudDB Database. Suppose I have the following sample data:
user_id
tweet_id
tweet_date
tweet
128
6
2024-02-01
#life is full of surprises.
133
9
2024-02-01
I am #...
0
votes
2
answers
67
views
Adding missing commas to strings matching a given pattern
I am trying to add a comma and a space to my strings. Here are some examples:
{ELEPHANT:1, FENNEC_FOX:1NAKED_MOLE:1URCHIN:2}
{DUNG_BEETLE:12URCHIN:1}
{DUNG_BEETLE:1FENNEC_FOX:1URCHIN:2}
Notice the ...
0
votes
1
answer
26
views
String Escape Inconsistencies Snowflake vs dbt
I'm cleaning an array-like string so that it's a proper array type with proper quoting.
Example Input:
['Home & Kitchen / Kitchen & Dining / Dining & Entertaining / Glassware & ...
1
vote
3
answers
65
views
Parsing key-value pairs, selecting based on value, and creating new column with SQL
I have a my_table like this. Col2 is a string type:
| Col1 | Col2 |
|--------------|------------------------------------|
| some_string |{siblings:0, pets:1, ...
-3
votes
1
answer
35
views
order by a string with number and letter
I want to order by a string in sql that have number in it and I want orderby number as number instead of string
these are sample string
I try this but it does not work:
SELECT * FROM testTbl
ORDER ...
2
votes
2
answers
89
views
MySQL procedure to convert formula to list of numbers
I have a list of alphanumeric strings that includes two special characters + and -. The input, as shown below, represents part numbers for our company's products. I would like to extract the ...
0
votes
1
answer
74
views
String Manupulation using DB2
I have a table with current preferred Customer services, and I want to create and engine to push for the Next Possible Best Offer.
My table looks like this:
Customer ID
PREFERRED_SERVICE
aaaa
...
0
votes
1
answer
113
views
BigQuery SQL Cast error: No matching signature for operator = for argument types: STRING, INT64. Supported signature: ANY = ANY
I'm getting this error while running a query in BigQuery in the part of 4th line (highlighted in italics).
In this query, table 1 has a data field 'Lsc' as String data type and table 2 has a data ...