i want a query to fetch item onhand with the current layer cost with a combination of valuation unit
Summary:
Attaching the code i am trying to run which is having a performance issue and could'nt figure out a way to fetch the layer cost of an item at a particular subinventory along with onhand quantity.
Content (please ensure you mask any confidential information):
Version (include the version you are using, if applicable):
Code Snippet (add any code snippets that support your topic, if applicable):
with cost_date as
(select distinct inventory_item_id , max(cost_date) cost_date , val_unit_id
from cst_layer_costs
group by
inventory_item_id,
val_unit_id)
select
egp.item_number item_number,
0