[Solved] C# appointing distinct array elements randomly to another array

A simple solution: int[] card1 = nums.OrderBy(it => Guid.NewGuid()).Take(6).ToArray(); Ordering the original array by a new guid should give you a decent approximation of randomness while avoiding the requirement to explicitly guard against duplication. Then you just take the first 6 results. Warning: The random-like behaviour of ordering by guid is an implementation detail of … Read more

[Solved] Using distinct for specific column in oracle

In your example the query returns distinct values for the combination of COLA and COLB. Examine the syntax: Note, that DISTINCT/UNIQUE/ALL can be only placed after SELECT and before of the first expression in the select list. The documentation says that:https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm DISTINCT | UNIQUE Specify DISTINCT or UNIQUE if you want the database to return … Read more