Skip to content

Tag: sql-server

SQL Server – current inventory with physical count

I feel as though I’m missing something extremely fundamental that should be obvious. I’m basically trying to take the below data and calculate a fifth column: Inventory_Current. Example data: DateStamp ProductID Inventory_Change Inventory_Count 2021-07-01 100 -300 100000 2021-07-01 200 -700 50000 …

Insertion of dynamic values to specific colums using SQL

I’m trying to insert a new row into a table, but one column’s value insertion is dependent on a specific rule. So far I get an error because SQL doesn’t support my way and I have no idea what to do: How can I insert the max(RNFIL170.SEDER_HATZAGA)+1 into RNFIL170 ? Answer use INSERT INTO &#8…

Display individual elements from grouped rows on same row

I want to both group some rows together but return 1 column of the individual rows from the group onto the same line as well, probably easiest to show with an example…. Original Data Grouped by rDate, track, AVG(odds) Desired output, grouped with average odds but with individual odds added to grouped ro…