How do you get rid of the back slashes, but still keep the double quotes when using json_array? TABLE A: Wrong code: Wrong output: Desired output: And yes, I know you can just concatenate like so “select ‘[‘|| etc. without using the json_array, but I need to have that in the code. Is there a…
Tag: oracle
How can I resolve “success with compilation error” error while creating trigger in Oracle PL/SQL?
I am trying to create a trigger that updates “event” table rather than updating the “v_event” view. When I run this script I get “success with compilation error” error. What am I doing wrong? Answer Pay attention to what you do. In order to find out what went wrong, either …
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
Sorting and Number results based in order, using multiple columns “order by” criteria
all I’ve been trying to do, with data following the structure: To get the following: Basically, to order the alphabetical field in ascending order, the numerical field in descending order and get the order or rank by using the order used for the numerical field, grouped by the alphabetical field. I have…
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 …
what is the query in oracle sql to find product orders before a certain date?
how do i find all the customers who have made orders before 2017. List must incld the customer ID, customer name, and ordered by their ID values in desc Answer You can use exists and a correlated subquery to filter customers who ordered before 2017. We can get that information by looking at the orders table o…
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…
Cannot figure out writing a compound SQLquery to the Oracle database
Please help me sort out the request: Develop a query to calculate the number of news, written by each author and the most popular tag, referred to author news. All these information must be output in one single result set. I wrote the first part of the request, it displays the amount of news for each author: …
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 …