Differences
This shows you the differences between two versions of the page.
control_sql_-_duplicate_companies [2019/01/27 11:28] |
control_sql_-_duplicate_companies [2019/01/27 11:28] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== | ||
+ | |||
+ | |||
+ | |||
+ | Control provides an option as to whether duplicate companies are allowed. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Explanation of SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | If a customer receives a " | ||
+ | |||
+ | |||
+ | |||
+ | For a complete listing of duplicate company names, you can use the following query. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Risk of Data Corruption if Run Improperly ===== | ||
+ | |||
+ | **None**. This is a selection query and no data is modified in the running of it. | ||
+ | |||
+ | |||
+ | |||
+ | ===== SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | <code sql> | ||
+ | SELECT CompanyName, | ||
+ | FROM Account | ||
+ | GROUP BY CompanyName | ||
+ | HAVING Count(CompanyName) > 1 | ||
+ | ORDER BY TheCount DESC, CompanyName | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Version Information ===== | ||
+ | * Entered : 8/15/2009 | ||
+ | * Version : Control 2.5+ | ||
+ | |||
+ | |||
+ | |||