aboutsummaryrefslogtreecommitdiff
path: root/res/sql/views
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-02-08 20:06:39 +0100
committerPacien TRAN-GIRARD2015-02-08 20:06:39 +0100
commit4496e089bca542fc98bfad0e005469211e7cbc1e (patch)
tree8e8473f34d339468eaceb42cee97a9db7f60770e /res/sql/views
parentc00cb6ae05f548f7ae270a93ad44f57207380406 (diff)
downloadminibay-4496e089bca542fc98bfad0e005469211e7cbc1e.tar.gz
Implement current sales listing
Diffstat (limited to 'res/sql/views')
-rw-r--r--res/sql/views/orcl_sales.sql2
-rw-r--r--res/sql/views/pg_sales.sql2
2 files changed, 4 insertions, 0 deletions
diff --git a/res/sql/views/orcl_sales.sql b/res/sql/views/orcl_sales.sql
index 851d17e..b585819 100644
--- a/res/sql/views/orcl_sales.sql
+++ b/res/sql/views/orcl_sales.sql
@@ -2,11 +2,13 @@ CREATE OR REPLACE VIEW sales AS
2 2
3 SELECT 3 SELECT
4 items.uuid AS item_uuid, 4 items.uuid AS item_uuid,
5 items.item_name AS item_name,
5 items.user_uuid AS seller_uuid, 6 items.user_uuid AS seller_uuid,
6 items.start_date AS start_date, 7 items.start_date AS start_date,
7 items.end_date AS end_date, 8 items.end_date AS end_date,
8 best_bids.uuid AS best_bid_uuid, 9 best_bids.uuid AS best_bid_uuid,
9 best_bids.user_uuid AS best_bidder_uuid, 10 best_bids.user_uuid AS best_bidder_uuid,
11 items.initial_price AS initial_price,
10 best_bids.offer AS best_offer, 12 best_bids.offer AS best_offer,
11 COALESCE(charges.fee, 0) + COALESCE(charges.rate, 0) * best_bids.offer AS charges 13 COALESCE(charges.fee, 0) + COALESCE(charges.rate, 0) * best_bids.offer AS charges
12 14
diff --git a/res/sql/views/pg_sales.sql b/res/sql/views/pg_sales.sql
index f36d8e7..f1705f1 100644
--- a/res/sql/views/pg_sales.sql
+++ b/res/sql/views/pg_sales.sql
@@ -2,11 +2,13 @@ CREATE OR REPLACE VIEW sales AS
2 2
3 SELECT 3 SELECT
4 items.uuid AS item_uuid, 4 items.uuid AS item_uuid,
5 items.item_name AS item_name,
5 items.user_uuid AS seller_uuid, 6 items.user_uuid AS seller_uuid,
6 items.start_date AS start_date, 7 items.start_date AS start_date,
7 items.end_date AS end_date, 8 items.end_date AS end_date,
8 best_bids.uuid AS best_bid_uuid, 9 best_bids.uuid AS best_bid_uuid,
9 best_bids.user_uuid AS best_bidder_uuid, 10 best_bids.user_uuid AS best_bidder_uuid,
11 items.initial_price AS initial_price,
10 best_bids.offer AS best_offer, 12 best_bids.offer AS best_offer,
11 COALESCE(charges.fee, 0) + COALESCE(charges.rate, 0) * best_bids.offer AS charges 13 COALESCE(charges.fee, 0) + COALESCE(charges.rate, 0) * best_bids.offer AS charges
12 14