Skip to content

Tag: regex

SQL query to get / delimited column value in single row

I have this output: Table 1 Requisition_number per_id per_name Job_title Interview TAS_EMAIL_ADDRESS TAS_FNAME 22021 1097 Chad Manager This is a comment abc.g@gmail.COM abc 22021 1097 Chad Manager This is a comment xyz.g@gmail.COM xyz I want the output to look like this: Requisition_number per_id per_name Job…

SQL – trimming values before bracket

I have a column of values where some values contain brackets with text which I would like to remove. This is an example of what I have and what I want: I have only come across approaches that use the number of characters or the position to trim the string, but these values have varying lengths. One way I was

BigQuery SQL Regex_extract repeated pattern

New to regexp, below is the sample query and our try as below union all select ‘https://www.this-is-pqrs.com/<some_text>/ab.abc.ef.gh.ij/123456.csv’ str union all select ‘https://www.this-is-pqrs.com/<some_text>/ab.abd.ef.gh.ij/123456.csv’ str union all select ‘https:…

Snowflake Regular Expression

I have this string in Snowflake column: I need to get names in this format regardless of the number of company names: “SpecTra, Signal Capital Partners”. In other words, I need to extract company names and concatenate them. I have tried this : and regexp_substr() function, but did not get the desi…

translate query from Oracle to Postgres

I need to translate this query from Oracle to Postgres: can someone help me? thanks in advance for your attention and support Answer In postgres the operateur ~ performs a regex comparison as thus replaces the Oracle function regexp_like(). Your query therefore becomes. I would like to alert your attention th…

SAME SQL regexp_extract, different impala and hive output. Why?

The same SQL command has two different output on Hive and Impala: Hive output: ff Impala output: ffff Why such difference? Please explain difference in terms of each engine’s method of processing and outputting characters space-by-space, from left to right or right to left, step by step, and the reasoni…