Skip to content

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 tablena…

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.

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 …

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 ca…