Skip to content

Tag: split

How to split an XML string into parts with different keys

from XML column I wanna try get info. Every client have more that one contract_key in XML, im using split_part and strpos for get needed information : But problem is this function return the first match found: ID Key amountR AVGamount 2253545 1 10000 50 this client in same XML have more Contract_key: ID Key amountR AVGamount 2253545 5 70000

Split multiple strings in SQL

I am trying to split multiple columns of strings at the same time. My original data looks like: Table1 UserID Type ProductID 1 A, B 001, 003 and I want to end up with UserID Type ProductID 1 A 001 1 B 003 When I use I end up with this table that I do not want… UserID Type ProductID

How to create table from an existing table

I’m in Oracle APEX and would like to create a new table from other existing one like this: I have a column in a SONGS table that is: ARTIST NAME Another header Bad Bunny row Bad Bunny, Ozuna, Daddy Yankee row And I want this in another table: ID Artist 1 Bad Bunny 2 Ozuna 3 Daddy Yankee Also, from

Splitting strings in SQLite

Does anyone know how to split my address columns. I would like to divide it into three new columns, seperated by it’s commas. For example 1808 FOX CHASE DR, GOODLETTSVILLE, TN is divided into 1808 FOX CHASE DR GOODLETTSVILLE TN So far I’ve tried Although I cannot create the third column with the state abbreviation. Thanks for any input Answer

SQL query to split and keep only the top N values

I have the following table data: I need to create a table with a split items column, but with the limitation to have at most N items per name. E.g. for N = 3 the table should look like this: 
I have the following query that splits items correctly, but doesn’t account for the maximum number N. What should I

Postgres: Split column values & transpose

I have a table like this: And I want to convert it to this: I have tried splitting the column based on ; but the product_id count varies based on the category_id. Is there anyway I can achieve this? Answer You can use PostgreSQL’s array manipulation functions: string_to_array does exactly what it says — splits a string into an array

How to extract everything after parentheses in BigQuery?

How can I extract all the characters after the first word? For example, I would like to have (084M) in its own column with the parentheses included. I’ve tried to SPLIT and REGEXP_EXTRACT but I have ran into issues. Table: Name Elizabeth (084M) Elizabeth (084M) Elizabeth (084M) Pittston (14KN) Pittston (14KN) Pittston (14KN) Cheektowaga (14ON) Image of Table: Answer use

Trimming the beginning and end of string in SQL

I have quite a long string that I want to trim the beginning and ending of. See a random example below: { “topic”: “birds”, “body”:”cool bird”, “attachment1″:”bird1”, “attachment2″:”anotherbird” } My desired output: “attachment1″:”bird1”, “attachment2″:”anotherbird” I want to keep the attachments so I would have to trim everything up to the first attachment “attachment1” and get rid of the ‘}’ as