Changes between Version 7 and Version 8 of AdvancedAppDevelopment
- Timestamp:
- 09/30/25 03:07:48 (2 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedAppDevelopment
v7 v8 175 175 select r.region_name as region, 176 176 cat.ctg_name as category, 177 sum(asales.unitsSold) as totalUnitsSold,177 sum(asales.unitsSold)::bigint as totalUnitsSold, 178 178 sum(asales.income) as totalIncome 179 179 from ArticleSales asales … … 286 286 create or replace function YearlyIncomeProfitAndExpensesByWarehouses() 287 287 returns table( 288 warehouseId bigint,288 warehouseId integer, 289 289 warehouseCity varchar(128), 290 290 warehouseRegion varchar(128), … … 300 300 c.city_name as warehouseCity, 301 301 r.region_name as warehouseRegion, 302 extract(year from o.ord_date) as "year",303 sum(o.ord_sum) as totalIncome,304 sum(ord_sum)-sum(au.unit_cost_price) as total_profit302 extract(year from o.ord_date)::double precision as "year", 303 sum(o.ord_sum)::decimal(10,2) as totalIncome, 304 (sum(o.ord_sum)-sum(au.unit_cost_price))::decimal(10,2) as total_profit 305 305 from warehouse w 306 306 join city c on w.city_id = c.city_id … … 347 347 and o.ord_date >= p.price_eff_date 348 348 group by a.art_id, a.art_name, cat.ctg_name) 349 select art_id,350 art_name,351 category,352 totalUnitsSold,353 totalIncome,354 totalCost,355 totalProfit349 select ProductSales.art_id, 350 ProductSales.art_name, 351 ProductSales.category, 352 ProductSales.totalUnitsSold, 353 ProductSales.totalIncome, 354 ProductSales.totalCost, 355 ProductSales.totalProfit 356 356 from ProductSales 357 order by totalProfit desc;357 order by ProductSales.totalProfit desc; 358 358 end; 359 359 $$;