Have the following hypothetical table User_Mail_Info in Oracle DB Primary key is User_Id,Mail_DL,DLId. There are other columns with the table as well. How to retrieve the UserId ,given the list of (Mail_DL and DL Id) ? Note: Mail_DL and DL_Id are not directly related. This is just hypothetical data For eg. In…
Tag: oracle
Oracle SQL randomising column entries
I have the below table: PC A MAXI PC1 A1 1 PC1 A2 2 PC1 A3 3 PC2 A1 1 PC2 A2 2 PC2 A3 3 Is there a way to generate ‘MAXI’ entries for each group of ‘PC’ and ‘A’ in a random order (or at least a seemingly even distribution, even if not random)? Desired output (count_pc would
Oracle SQL – Custom Sort
I have a scenario where I have following data: Table: Locations I want to sort in a way that all the IDs that end in ‘0000’ should be sorted first, then the TYPE ‘Warehouse’ and then the rest of the Stores. The desired output should be like How do I do this custom sorting? Answer This …
Query to pull transactions where dispute date exceeds payment date by 120 days
Super new with SQL and just was wanting a nudge in the right direction I have a payment table with column a) payment date and column b) dispute date. I want to pull all transactions where the dispute date exceeds the payment date by 120 days. I think it should have something to do with a CASE function but aga…
Oracle SQL – Outer join based on concat
I need to cross join two tables but the joining conditions are: Select FutureInventory.Item, To_Number(Concat(Location, Channel_Id)) Location, From V_CUST_FUTURE_INV_POSITION FutureInventory, …
Sum value is too big when adding a another table ORACLE SQL
When I want to sum two values from two different tables – the tickets sold out on match and the TV transmission i got too big sum value in result. I figured out that for single match transmission cost is X times too big, where X is a number of tickets for this match, only when I join a tickets
Assignation counting up to maximum
I have the below 2 tables: aux1: PC A MAXI PC1 A1 1 PC1 A2 2 PC2 A1 1 PC2 A2 2 aux: VK D PC VK1 8 PC1 VK2 7 PC1 VK3 6 PC2 VK4 5 PC2 VK5 4 PC1 VK6 3 PC1 VK7 2 PC2 VK8 1 PC2 I would like to obtain the following output: VK D
Using oracle apex dynamic action to set a date time value that is concatenated
I have a date value in one page item and i have a time value in another. i want to concat the date with the time and set it to another item using a dynamic action. Structure as below P_DATE = ’01-01-2021′ (item is a date with format mask dd-mm-yyyy) P_TIME = ’08:30 AM’ (item is date wi…
Oracle Like Operator in Where condition and decode
I’m trying to write a PL-SQL query to return records from multiple table and using decode to allow null value comparison, The result is returning only where DeptName is exactly matching to the database values, but I want a query to return something e.Department like ‘%DeptName%’ Answer No ne…
Check if all values in a column falls into a specific group
I have the following table: and I want to check ALL values of the column ‘Token’ and return a flag string to designate what condition is met: when all records are in group (A, B) –> return ‘Condition1’, examples: when all records are in group (A, B, C) –> return ̵…