Skip to content
Advertisement

Tag: regex

Oracle View loop on specific tables only

I got many tables of which some end with digits (date). Due to technical reasons I had to create a view on every table (just a workaround) The current state is something like: All it does is creating views for every table which begins with ‘XXX_’. Its almost what I need. But now, sometimes tablenames look like “XXX_tablename_20210302”, which is

How to regex match multiple items

I have a reviews table as follows: r_id comment 1 Weight cannot exceed 40 kg 2 You must not make the weight go over 31 k.g 3 Don’t excel above 94kg 4 Optimal weight is 45 kg 5 Don’t excel above 62 kg 6 Weight cannot exceed 7000g What I want to select is the weight a r_id’s cannot exceed.

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

Extract number between two characters in Hive SQL

The query below outputs 1642575.0. But I only want 1642575 (just the number without the decimal and the zero following it). The number of delimited values in the field varies. The only constant is that there’s always only one number with a decimal. I was trying to write a regexp function to extract the number between ” and .. How

Perform a particular ILIKE query on Postgresql

I have a problem with a query in Postgres. I have a column with values such as: id@@@Name1@@@other text@@@other_text@@@other_text@@@CODE@@@other_text### id@@@Name2@@@other text@@@other_text@@@other_text@@@CODE@@@other_text### id@@@Name3@@@other text@@@other_text@@@other_text@@@CODE@@@other_text### Each row can have different string suchs as the above. The @@@ separates each part of the string-block. The ### separates each string-block. @@@ and ### are so a “references”. With my query I have to find,

How to select values between a XML tag in SQL Query

I have a table with CLOB column storing a XML. The structure of XML is unreadable. I want to get values between few tags like <DOMAINID>; sample is shown below. XML: I am using this: Expected result: Actual XML: Answer Do not use regular expressions to parse XML; use a proper XML parser. However, what you have is not properly

Advertisement