I try to find another examples, but I have not been able to find one that can help me I am currently trying to find if the value in the STR_ROUTE column is in the STR_STREET column, as shown in the following example ID STR_ROUTE STR_STREET 1 MAIN Can 2 AV CAL 3 CLL CLL 4 STR VAL 5 VAL
Tag: oracle
REGEXP_SUBSTR is inconsistent with extracting digits before a comma/decimal point [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 14 days ago. Improve this question my regex looks like this: this returns the results just fine: regex value 11 11,2 5 5,2 11 11,4 6 6,6 however when a value
In case expression else part is not getting executed and giving wrong output
I have two tables one for transactional and the other one is a reference table. I need to get the output based on columns col_ans and col_pos_id and need to fetch the value from the reference table as per the below requirement. I need to check col_id equals 7 only. And all operation needs to happen on this col_id only.
SQL conditions with COUNT in select query
In the following SQL query, I want to display if factor count is greater than one select NULL else return factor. However, I get this error: EDITED It is working fine if we use it as follows, however, I need to use factor in else part and Null in IF part Answer You can’t use COUNT(factor) and factor in one
Extract month from number of days in a year
I am trying to extract month from number of day in year in Oracle SQL, for instance day 32 is february. I do not have permission to use procedure, so I have to do it just using select. Any help? Answer You get to the solution as follows. First convert the day X into a date and extract the month
SQL query return no rows
acid tran_id tran_date tran_particular tran_amt part_tran_type ab500 m1 01-01-2022 123:qwe 10 C ab500 m5 10-01-2022 124:qse 20 C ab500 m16 11-01-2022 123:pyh 10 D I have the above table named htd. I am trying to fetch the result where tran_particular is unique before the “:” Final output looking for: acid tran_id tran_date tran_particular tran_amt part_tran_type ab500 m5 10-01-2022 124:qse 20
Generate rows to fill in gaps between years, carry over a value from previous year
I have a table of road condition ratings (roads are rated from 1-20; 20 being good). db<>fiddle In a query, for each road, I want to generate rows to fill in the gaps between the years. For a given road, starting at the first row (the earliest inspection), there should be consecutive rows for each year all the way to
Why is the else condition triggered when the when condition is fulfilled?
I take a number for customer type and a string for currency from the user and return the current row. If the currency entered by the user is not available in the table then I should return the row in which the currency value is ‘all’. And if the currency entered by the user exists in the table, I need
Oracle sql: if I am doing a comparison operator on a date field do i still need a not null
If I am doing a comparison operator (>, <, =) on a date field do I also need a IS NOT NULL on the date field Answer If I understood you correctly, then no – you don’t have to check whether it is not null. For example (today is date ‘2022-07-07’, 7th of July 2022): If you include the not
Why does CROSS JOIN LATERAL break up array’s SDO_GEOMETRY object into individual attributes?
Oracle 18c: I have mapping software that has a limitation where it can only handle a single geometry column per table. If there are multiple geometry columns in a given table, then it will throw an error. So, I want to find a way to add an additional geometry column to a table, but store it as a datatype that