How to make “No Duplicates” column in SQL Server 2008?

Add a unique constraint for that column: ALTER TABLE Foo ADD CONSTRAINT UQ_Name UNIQUE (Name) To add it through SQL Management Studio UI: Open SQL Server Management Studio. Expand the Tables folder of the database where you wish to create the constraint. Right-click the table where you wish to add the constraint and click Design. … Read more

Count unique values in a column in Excel

To count the number of different values in A2:A100 (not counting blanks): =SUMPRODUCT((A2:A100<>””)/COUNTIF(A2:A100,A2:A100&””)) Copied from an answer by @Ulli Schmid to What is this COUNTIF() formula doing?: =SUMPRODUCT((A1:A100<>””)/COUNTIF(A1:A100,A1:A100&””)) Counts unique cells within A1:A100, excluding blank cells and ones with an empty string (“”). How does it do that? Example: A1:A100 = [1, 1, 2, “apple”, … Read more

Merge two numerically-keyed associative arrays and preserve the original keys

Just use: $output = array_merge($array1, $array2); That should solve it. Because you use string keys if one key occurs more than one time (like ’44’ in your example) one key will overwrite preceding ones with the same name. Because in your case they both have the same value anyway it doesn’t matter and it will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)