หาค่าออกมาได้แล้ว
case
when round(product_uom.factor) > 1 then stock_move.product_qty
when round(product_uom.factor) < 1 then stock_move.product_qty / product_uom.factor
else stock_move.product_qty * (select round( max(factor) ) from product_uom uom2
where uom2.category_id = product_uom.category_id)
end as max_factor
ต้องการให้แสดงเป็นแต่ละเดือนด้วย
case date_part('month',stock_picking.date_done)
when 1 then product_qty
else 0
end as january
จะเอา 2 อันนี้มารวมกันยังไงคะ เพื่อให้คำตอบออกมาเป็นแต่ละเดือน
การใช้ case when ซ้อน case when ต้องเชื่อมยังไงคะ
Moderator: mindphp
-
- PHP Full Member
- Posts: 32
- Joined: 06/08/2011 11:26 am
-
- Similar Topics
- Replies
- Views
- Last post
-
- 0 Replies
- 2455 Views
-
Last post by thitikorn_lp
17/01/2015 3:12 pm
-
- 0 Replies
- 1513 Views
-
Last post by M027
07/08/2015 3:11 pm
-
- 0 Replies
- 1820 Views
-
Last post by jay_limm
04/06/2014 11:43 am
-
- 1 Replies
- 993 Views
-
Last post by makup
11/10/2020 3:54 pm
Who is online
Users browsing this forum: No registered users and 1 guest