Skip to content

Tag: oracle

Oracle SQL query partially including the desired results

My requirement is to display country name, total number of invoices and their average amount. Moreover, I need to return only those countries where the average invoice amount is greater than the average invoice amount of all invoices. Query for Oracle Database Result: Austria 1 9500 Expected: Austria 2 4825 S…

How to only display current and valid data from 2 tables in sql

I have these two tables: Table imp_source: Table imp_update: I need to write a query to have this result: All values of imp_update The values of imp_source when there is no update for seq column of a product/class combination. Update 1: As you can see, the row in imp_source is not in result Because in imp_upd…

Oracle SQL query to get comma-separated string in single query

I have a data which is represented as below: I have a query as follows which has to be tweaked to get parent and child names respectively My output should look as follows: I basically want to split the lk.name based on seperator (,) and 1st string before seperator is parentName and 2nd string after seperator …