finki-main
main
|
Last change
on this file since 33517cc was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 2 weeks ago |
|
Project Handcraft Marketplace
|
-
Property mode
set to
100644
|
|
File size:
366 bytes
|
| Line | |
|---|
| 1 | CREATE OR REPLACE VIEW vw_monthly_sales_profit AS
|
|---|
| 2 | SELECT
|
|---|
| 3 | s.store_id,
|
|---|
| 4 | s.name AS store_name,
|
|---|
| 5 | r.date,
|
|---|
| 6 | r.month_and_year,
|
|---|
| 7 | r.profit,
|
|---|
| 8 | r.overall_profit,
|
|---|
| 9 | ed.monthly_profit,
|
|---|
| 10 | ed.sales,
|
|---|
| 11 | ed.damages
|
|---|
| 12 |
|
|---|
| 13 | FROM store s
|
|---|
| 14 | JOIN report r
|
|---|
| 15 | ON r.store_id = s.store_id
|
|---|
| 16 | LEFT JOIN exchanges_data ed
|
|---|
| 17 | ON ed.store_id = r.store_id
|
|---|
| 18 | AND ed.date = r.date;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.