This commit is contained in:
2021-01-22 15:09:11 +00:00
parent fd9ee04f8c
commit f8604e172f

View File

@@ -158,7 +158,9 @@ todo: find a way to do a stock picking list format and expose in UI
I'm thinking some kind of built in view based on a query that I can treat like a tble object with my existing datalist code
//This works with one warehouse, will test with two to see what the what
create view TestStockPickingView as WITH T AS (SELECT *, ROW_NUMBER() OVER(PARTITION BY partid ORDER BY entrydate DESC) AS rn FROM apartinventory) SELECT * FROM T WHERE rn = 1
create view v as WITH T AS (SELECT *, ROW_NUMBER() OVER(PARTITION BY partid ORDER BY entrydate DESC) AS rn FROM apartinventory) SELECT * FROM T WHERE rn = 1
WITH T AS (SELECT *, ROW_NUMBER() OVER(PARTITION BY partid, partwarehouseid ORDER BY entrydate DESC) AS rn FROM apartinventory) SELECT * FROM T WHERE rn = 1
then can just select * from TestStockPickingView and Bob's your lobster