Skip to content

Tag: oracle

How add more rows when find string in column Oracle

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…

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 …

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…

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 …