finki-main
main
|
Last change
on this file since 62b2964 was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 2 weeks ago |
|
Project Handcraft Marketplace
|
-
Property mode
set to
100644
|
|
File size:
525 bytes
|
| Line | |
|---|
| 1 | CREATE OR REPLACE VIEW vw_customer_order_history AS
|
|---|
| 2 | SELECT
|
|---|
| 3 | c.client_id,
|
|---|
| 4 | c.first_name,
|
|---|
| 5 | c.last_name,
|
|---|
| 6 | c.email,
|
|---|
| 7 |
|
|---|
| 8 | o.order_num,
|
|---|
| 9 | o.quantity,
|
|---|
| 10 | o.status,
|
|---|
| 11 | o.last_modified_date,
|
|---|
| 12 | o.payment_method,
|
|---|
| 13 | o.discount,
|
|---|
| 14 |
|
|---|
| 15 | p.code AS product_code,
|
|---|
| 16 | p.description AS product_description,
|
|---|
| 17 | p.price
|
|---|
| 18 |
|
|---|
| 19 | FROM client c
|
|---|
| 20 | JOIN makes_order mo
|
|---|
| 21 | ON mo.client_id = c.client_id
|
|---|
| 22 | JOIN "order" o
|
|---|
| 23 | ON o.order_num = mo.order_num
|
|---|
| 24 | JOIN includes i
|
|---|
| 25 | ON i.order_num = o.order_num
|
|---|
| 26 | JOIN product p
|
|---|
| 27 | ON p.code = i.code;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.