Sim Greenbaum
11/30/2023, 2:33 PMSELECT
AssemblyItem.islotitem AS parentlot ,
AssemblyItem.custitem3 as sku,
AssemblyItem.ID AS AssemblyItemID,
(SELECT islotitem FROM Item WHERE Item.id = AssemblyItemMember.Item )AS Memberlot,
AssemblyItemMember.Item AS memeberid,
BUILTIN.DF( AssemblyItemMember.MemberUnit ) AS MemberItemUOM,
inventoryItemLocations.item,
AssemblyItemMember.Quantity AS MemberItemQty,
inventoryItemLocations.quantityavailable,
FROM
Item AS AssemblyItem
INNER JOIN AssemblyItemMember ON
( AssemblyItemMember.ParentItem = AssemblyItem.ID )
INNER JOIN inventoryItemLocations ON AssemblyItem.ID = inventoryItemLocations.item AND inventoryItemLocations.location = 14
WHERE AssemblyItem.itemtype = 'Assembly' AND inventoryItemLocations.quantityavailable >0
Watz
11/30/2023, 3:12 PMSim Greenbaum
11/30/2023, 3:32 PMSim Greenbaum
11/30/2023, 3:33 PMShai Coleman
11/30/2023, 3:38 PMDISTINCT
and first_value
with a window function. Example:
SELECT DISTINCT basecurrency, transactioncurrency,
first_value(currencyrate.exchangerate) OVER (PARTITION BY basecurrency, transactioncurrency ORDER BY effectivedate DESC, currencyrate.id DESC) AS exchangerate
FROM currencyrate
Sim Greenbaum
11/30/2023, 3:43 PMSim Greenbaum
11/30/2023, 3:43 PMFIRST_VALUE(AssemblyItem.ID) OVER (PARTITION BY AssemblyItem.ID) AS AssemblyItemID
John Finlay
11/30/2023, 4:06 PMSim Greenbaum
11/30/2023, 4:07 PMSim Greenbaum
11/30/2023, 4:08 PMWatz
11/30/2023, 4:09 PMJohn Finlay
11/30/2023, 4:12 PMWatz
11/30/2023, 4:15 PMSim Greenbaum
11/30/2023, 4:35 PMSim Greenbaum
11/30/2023, 4:51 PMSim Greenbaum
11/30/2023, 4:52 PMJohn Finlay
11/30/2023, 4:57 PMSim Greenbaum
11/30/2023, 4:58 PMJohn Finlay
11/30/2023, 5:00 PMSim Greenbaum
11/30/2023, 5:01 PMSim Greenbaum
11/30/2023, 5:02 PMJohn Finlay
11/30/2023, 5:03 PMSim Greenbaum
11/30/2023, 8:45 PMJohn Finlay
11/30/2023, 8:50 PMJohn Finlay
11/30/2023, 8:52 PMSim Greenbaum
11/30/2023, 8:55 PMJohn Finlay
12/01/2023, 4:02 PMSim Greenbaum
12/04/2023, 4:22 PM