While analyzing performance of an SQL query in Oracle, I noticed a strange behavior. I noticed that Oracle’s plan behavior changes depending on value used in query. For example here is my table …
Oracle Selecting Index Optimisation
I need to optimise this query by using indexing. I tried to index some of the columns, but it is not helping. Is there anyone have thoughts? The query I need to optimise: Select vintage, wine_no, …
configure query to bring rows which have more than 1 entries
How to get those entries which have more than 1 records? If it doesn’t make sense… let me explain: From the below table I want to access the sum of the commission of all rows where type is joining …
Is it possible to use GRANT inside a trigger in Oracle 18c?
I try to create a trigger which automatically grants select on all new tables for a specific schema, whenever a new table in this schema is created. Background for this is IBM InfoSphere Information …
Query JSONB column for any value where =?
I have a jsonb column which has the unfortunate case of being very unpredictable, in some cases its value may be an array with nested values: [“UserMailer”, “applicant_setup_3”, [“5cbffeb7-8d5e-4b52-…
Select all columns with time formatting
I have many columns, some of them contains timestamp. I want to fetch all columns records but ones with date/time to be formatted: I know I can get all columns separately but there is 20 columns so I …
MYSQL – INSERT INTO table (column) VALUES (xxxx) WHERE column = 1;
I’ve seen similar questions but not quite hitting it on the head. I want to insert a value into a column, where a value in the column is equal to a certain value – ie 1. So, INSERT INTO table (…
How can an Oracle-user query a table in another schema in oracle18c?
I want the oracle-user c##user2 to query the table test in the schema c##user1, but when I query the table, I get the message “no rows selected”. Both users have the permissions “CREATE SESSION” and “…
mysql – running sums for multiple categories with group by clause
I have this table: CREATE TABLE tbl_sample ( ID SERIAL PRIMARY KEY ,sale decimal(10,2) ,pc varchar(45) ,trans_date date ); INSERT INTO tbl_sample VALUES (1,100, ‘p1′,’2019-08-27’ ),(2,150, ‘p2’,…
Creat procedure in mysql
I was learning sql from w3schools.Here is given simple mysql procedure but somehow I couldn’t to write down this procedure I’m new in sql please could you provide me with feedback. DELIMITER // …