I have a repository of SQL queries and I want to understand which queries use certain tables or fields. Let’s say I want to understand what queries use the email field, how can I write it? Example SQL …
Tag: regex
Unable to unnest in bigquery when there is comma inside list which is of type string
Unable to unnest in bigquery when there is comma inside list which is of type string. I have data in following format where value is type of string When I use following query, It is incorrectly splitting and unable to get logic right in regexp_replace With the above code, I am getting My expected output is I have followed following
Convert from sql query condition to REGEXP_LIKE
I am converting an SQL query condition like: I tried to execute query in Oracle using condition belove but no result return: Result look like for example 169011310 so _ are numeric characters Answer The $ in regex means end of string, you need to remove it because % in TSQL means any text, any zero or more chars, and
Problems passing a Python String to SQL query
I got some issues passing my SQL query made in Python to MS SQL. Were talking about retrieving some code via pyodbc, editing it with regex, and passing it back into a new table of the Database. I also tried some print()-Commands to assure the Code is running in Python and being edited the right way, but I am not
finding if a line starts with a specified string in a clob and then extract
I have a CLOB column that I want to search for a line that starts with ‘305’ then extract something from that line, some of my rows will have multiple lines that start with ‘305’ or ‘305 somewhere in the entire cell, so I’d only want to find the first line where it starts with ‘305’ the entire cell content
Redshift regex for before and after certain char
Data :- 1,2,3=20,4,5 select regexp_substr(data,’,3=[^,]*’) output = ,3=20 Desired output = 20 How do I get rid of,3=? I can add split_part(regexp_substr(Data,’,713=[^,]*’),’=’,2) but using the same expression would make sense. Thanks Answer You can extract a pattern using a subexpression:
Oracle SQL Developer limit number of character of datatype char(5)
I was tasked to implement a table with a variable groupcode. There are several requirements. char(5) 2 or 4 uppercase letters plus 1 digit whose value is between 1 and 4 (e.g., AA1, AABB1) Any input other violating point 1 and 2 should be banned The only thing I can come up with is regexp_like but my efforts are in
Oracle SQL Join an ID on a field with a list of IDs some with ranges
First of all, its not my database and I cannot change it:) This is an oracle database I have a table with 2 ID fields code and subcode: Table1 ID Code Subcode 1 300 010 2 400 050 3 300 060 I …
How to insert yes or no value into flag column based on regex query
I have a simple update that works great work analyzing a US based telephone number. It correctly inserts a Y in the phone_flag column based on the following query. UPDATE database.table SET phone_flag …
Extract all elements from a string separated by underscores using regex
I am trying to capture all elements and store in separate column from the below string,seprated via underscores(campaign name for an advertisement) and then I wish to compare it with a master table …