Categories
Database Development

How to distribution count between rows SQL Server

Unequal division = distribution How to retrieve output with example : CREATE TABLE yourTable ( id varchar(55), code int, count1 int, count2 int ); INSERT INTO yourTable (id, code,count1,count2) VALUES (‘no-29’, 12345, 4, 1), (‘no-29’, 32346, 4, 1) always count1-count2 and results distribution between others rows with same id: example : 4-1 = 3 and […]

Categories
Mastering Development

How to find set of lowest sum of distinct column elements in python?

Problem statement: There are 5 projects and 15 employees and the numbers against each column shows the interest of each employee in a given project. Each project can have a maximum of 3 employees. Scores are from 1-5 1 being the highest preference and 5 being the lowest preference. I have to divide the employees […]