Skip to content

Tag: oracle

Oracle SQL group by then sum

I have a table CUST_LOG with data below. How should I select above as below result? I want to group by CUST_ID then sum each status count by CUST_ID? I used OUTER JOIN but not work. The only way I found is use UNION clause as the following sql, but it is too complicated if there are many status. Answer

Load table from Oracle to MYSQL using python

Tried below code to load rows from Source(Oracle) to Target(MYSQL) Error Edited Updated Code_:- Error: Answer In Python, while all strive to adhere to PEP 249, no two DB-APIs are exactly the same especially in parameter implementation. Specifically, while the module, cxOracle, supports arbitrary placeholders …

SQL query execution plan and optimization (index)

I have to get the execution plan of a query, i did this: Then, the plan is obtained: Now, regarding the last points on predicate information, I have to optimize the execution plan using something like: create index… to solve the three last points. How could I do it? I have no idea about that! Thanks in …

How do I copy a column from one table to another table in sql

two tables region(region_id,region_name) countries(country_id,country_name,region_id) there are many country_id and country_name in countries table with region_id given multiple times to those countries ( region_id are only 4) I need to create a table or view where it shows region_name and number of countries…

How I can convert date to char and then ti number?

Please help to sole this task. I need convert date to char and then to number, so that i can perform arithmetic operation and divide the date by 2. This query doesn’t work and i have no idea how i can convert date to number. Answer Based on the understanding of the question I think you need the current …