Would it be possible to add more rows base on Keyword string in SQL ? table A table B Example: Output of the SQL should be – How to find string with keyword ‘FamilyCare’ in PromotionName of table A base on promotion_code of table B? If it exist it will add more rows in output Any help with t…
Tag: oracle
PL/SQL Block Finding number of suppliers for each nation
I’m still new to PLSQL and am currently using TPCH Dataset to practice. I have been trying this for a while not but I can’t seem to wrap my head around it and could use some advice. A rough overview of the dataset here. Here is my code so far However, when I tried just the select query, I got
sql query to pl sql procedure
this is my requirement .i want fetch the record from one table and store it in another temporary table.i wrote as query.but dont know how to make it as procedure by declaring varibales and so. Daily new customers data will gets inserted in table.I only want to fetch the customer data who signed attribute_valu…
How can I partition by group that falls within a time range?
I have the following table showing when customers bought a certain product. The data I have is CustomerID, Amount, Dat. I am trying to create the column ProductsIn30Days, which represents how many products a customer bought in the range Dat-30 days inclusive the current day. For example, ProductsIn30Days for …
Getting data from Oracle table where two columns equal separate lists
I am pulling data using python, from an ORACLE table. I can pull the rows I need for one of the lists using && the actual list is much longer What I can’t figure out is how to also include another filter from a different list. In this case it is a list of types Any help would be appreciated.
Invalid identifier in PLSQL
I want to print employee information according to employee-id. But when I compile code I get this error Here is my code Answer You should display local variables’ values, not table columns.
how to using BETWEEN in CASE
so I want to make a case where if between the year of acceptance and the current year (sysdate) it is 1 to 5 it will be rank 1 and 6 to 10 rank 2 I using the code like this But error it say ‘missing keyword’ in the when between 1 and 5 where EMPLOYEES table contains EMPLOYEE_ID,FIRST_NAME,HIRE_DAT…
Translate Oracle query into pandas dataframe handling
I have the below dataframe: PARAM1 PARAM2 VALUE A X TUE, WED A Y NO B X MON, WED B Y YES I would like a pythonic way of obtaining the distinct values of param1 that satisfy EITHER of these conditions: Their corresponding param2 = ‘X’ contains the string ‘MON’ Their corresponding param2…
Conditional where clause in Oracle SQL query is not working
I am trying to do a select on Oracle DB with this condition but it is not working. Table POST but when endDate is null I got the error Please help Answer The solution was to transform the Date in String, and in the select do this and (:endDate is null or pl.date_end <= TO_DATE(:endDate , ‘yyyy-MM-dd …
Oracle SQL: Using WHERE LIKE but for specific whole words / REGEXP_LIKE
I have a table of invoices with cost identifiers saved in a specific way, non always standard, like below: I would like to find invoices for a specific cost identifier. The structure of the cost is (4 or more digits)+(2 year digits) In Test case: 107621, the desired output would be ID: 2 and 3. SELECT * FROM …