I have following function and trigger- CREATE OR REPLACE FUNCTION function_copyX() RETURNS trigger AS $BODY$ BEGIN WITH updates (id) AS ( UPDATE tbl_history SET price=0 …
Sqlite Counter query
When I put query like counter and simple with (distinct nlri), I got a different number of results with timestamp..although the nature of both queries quite similar. is my counter query regarding …
How can I extract both column from View named “Max_part_supplied’? [closed]
I have created a view named ‘Max_part_supplied’ which consists of two column as Number_of_parts and Supplier_name. I am trying to access the Supplier_name who supplies maximum number of parts, as …
Modifying a value in a table using PL/SQL
I have only just begun to learn procedures in SQL. I have hit a bit of a wall and can’t seem to come to a fix. I am trying to create a procedure that will allow me to pass the item description and a …
how to group by sql data in a sub-query to show evolution
I have my sqlite database which contains urls and the number of times it has been visited per week. it’s stored this way : uid, url, date, nb_visits,… I would like to get every single URL with the …
Create a boolean column and fill it if other column contains a particular string in Pyspark
I am new to Pyspark Dataframe. I have a pyspark dataframe which has a column which contains value in below format Col1 a+ b+ a- b- I want to create another boolean column (Col2). Value for this …
How to subtract Expenses from Gross Profit from sql plus query?
I have to calculate Net profit So i have following query. How can i subtract “Total Expenses” from “Total Gross Profit”: SELECT SUM(orders.quantity * orders.price) AS “…
Inserting large amounts of generated test data into postgresql database
I want to insert a billion rows of floaty data into a postgresql database so that I can test the performance of various postgis functions. My effort below takes ages and seems to be really inefficient …
How to test PL/SQL procedure with varray input
I’ve made a procedure that uses a varray as input, and while everything compiles correctly, I can’t figure out how exactly to test/execute the procedure that actually works. The varray takes in at …
How to retrieve the properties stored in SQL with multiple inheritance
I’m storing the records in SQL that represent a multiple inheritance relationship similar to the one in C++. Like that: CREATE TABLE Classes ( id INTEGER PRIMARY KEY, name TEXT NOT NULL ); …