I need to order a column and there are a lot of elements null or empty.The problem is null element are ordered differente from null element The result about is that employees with name==null are the first position, after there are the elements with name!=null (are a real name) and at the end there are the ele…
Tag: oracle
Create new Event_ID based on ID with sliding window on date column
Imagine I have a table like ID Date 1 2021-01-01 1 2021-01-05 1 2021-01-17 1 2021-02-01 1 2021-02-18 1 2021-02-28 1 2021-03-30 2 2021-01-01 2 2021-01-14 2 2021-02-15 I want to select all data on this table, but creating a new column with a new Event_ID. An Event is defined as all the rows with the same ID, wi…
Oracle move strings to another matching row
I have a table called tblrespondent and my data looks like this: I have several case numbers that have multiple rows like this and I need to move all the comments into the lowest orclid13. The result would look like this with a semicolon in between each comment. How would I approach this? Many thanks in advan…
Using declared variables in SQL Oracle query FOR LOOP
I’m attempting to write a query script where I declare a variable and then use them in a select statement in Oracle SQL. Basically script should check if parent tables’ entries are used in referenced table or not. if not –> delete the entry from REF table. So far I have this So far LOG_MS…
Oracle SQL Pivot with Conditions convert rows to columns
I have the a table ITEM_SF with the following data I want to convert the data into Columns with a few conditions: My desired result is to show Charges, Discounts , Amount Paid and Tax Charges include (BookFees, HealthFees,RegistrationFees,SSCFees,TuitionFees,GeneralFees) Charges , Discount is Sum of ITEM_AMT …
how to fetch email address from oracle database
Hi All i am trying to fetch certain email patterns from oracle db 11g i have used the below queries Unfortunately i have to scan through the complete schemas in order to fetch the value (@pqr.de) where ever it exists in which ever column and table it is residing , ideally this activity is to list out inactive…
How can I find the right size box for each product?
I am sorry for re-uploading this quesiton, but I really want the answer. Kindly allow me to ask this question again and hope your kind support. The question is to find the right size box which allow the logistic business to save the money when shipping. We have 2 tables which are boxes and products. Boxes tab…
Populating rows in table with previous row value oracle sql
Here above the data is grouped by person then their duties are listed : I need a way to get the data to look like this using oracle sql : having a bit of trouble iterating over every row… dont mind if its plsql – sql prefered tho Tried a few things… but it goes back to null after the
How to Return paper title and number of authors for each paper using sql
I try to return paper title and number of authors for each paper,names of authors who have at least two papers and List names of authors who have co-authored with Dr. Chen. but i don’t find any way. Author Editor Paper Paper_author ) paper_review Reviewer Sample Inputs Author Editor Paper paper_author p…
How to get partial string in oracle
I need to find all the users in the table that have this pattern I only know the first 10 digits, the email address can be different. I did something like this, but I get nothing back Is there another way that I can capture this data in oracle? Thank you! Answer More a comment that a real answer, but