Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show only
|
Search instead for
Did you mean:
This page has been translated for your convenience with an automatic translation service. This is not an official translation and may contain errors and inaccurate translations. Autodesk does not warrant, either expressly or implied, the accuracy, reliability or completeness of the information translated by the machine translation service and will not be liable for damages or losses caused by the trust placed in the translation service.Translate
I recently got into a situation where I wanted to know how many distinct values were in a column of a table. It would be nice to be able to use the following:
SELECT COUNT (DISTINCT column-name) FROM table-name
The DISTINCT keyword does have its uses, but many problems where you need it can be solved by using the Group by statement: This will give you a list where each new distinction of column name has its own row. Now you can iterate through the distinctions.
SELECT COUNT(*), [column-name] FROM table GROUP BY [column-name]
How can I use DISTINCT to list out distinct values from the column into another table?
Already tried the following code and got the error "time: 0.000000 exception: FlexScript exception: Could not parse query SELECT DISTINCT ModelName FROM ProductionOrder at MODEL:/Tools/UserCommands/WriteStationMaps/code"
string sql4="SELECT DISTINCT ModelName \
FROM ProductionOrder";
Table result4=Table.query(sql4);
result4.cloneTo(Table("UniqueModelNames"));