I gang

PostgreSQL: Create SQL statement/stored procedure

I need a stored procedure (in PLPgsql or SQL) or a pure SQL statement. The database schema is:


CREATE TABLE receipts (


entry_date DATE,

amount NUMERIC(20, 2) DEFAULT 0.00


DROP TABLE IF EXISTS bank_transactions;

CREATE TABLE bank_transactions (

id serial NOT NULL,

transaction_date DATE,

amount NUMERIC(20, 2)


The point of your procedure is to match any group of bank_transactions to any group of receipts or the other way around, so that the sum of the amount in a group equals the sum of the amount in the other group. For example the following two rows in receipts table will match a row in transactions with the amount 20.00:



One or more rows in receipts may match the sum of one or more rows in transactions, and the other way around. The output of your query or stored procedure should be in the following format:

array of ints of matching receipt ids array of ints of matching transaction ids

[1, 3, 8] [2,3,8]

The example data above means that the sum of receipts with ids 1, 3 and 8 match the sum of the transactions with ids 2, 3 and 8. Please use the array data type for this.

The price for this project is 20$ and the deadline is 2 days.

Please provide your [url removed, login to view] username in your bid.

Evner: Database Administration, SQL

Se mere: sql statement stored, sql price, sql create table price, postgresql any, github price, stored, Sql Database administration, postgresql c++, database receipts, sql query format, schema sql, 2013 query, Create sql database, point matching, username ids, postgresql serial, postgresql procedure, stored procedure create sql, postgresql sql, database procedure, create stored procedure postgresql, postgresql table, price matching data, sql query sum, project sql query

Om arbejdsgiveren:
( 165 bedømmelser ) Copenhagen, Denmark

Projekt ID: #4088429

Tildelt til:


Hello, I can done this task quickly. Please check your PM. Thank you.

$8 USD / time
(6 bedømmelser)