The following is my statement that I put in SQL View :
SELECT DISTINCT
NO, Name, IndexNumber, Type1, Type2, StockCode,
StockShortName, ISIN
FROM Entity
WHERE (Name IN
(SELECT Name
FROM Entity AS Tmp
GROUP BY Name
HAVING COUNT(*) > 1))
ORDER BY Name
I encounter this error message when I save :
"ODBC error : [Microsoft][ODBC][SQL Server Drive]]SQL Server]An ORDER BY clause is invalid in views, derived tables, and subqueries unless TOP is also specified."
I check the syntax using SQL Query Ananlyzer, it doesn't have any error and it works fine showing all the records Order By Name.
I tried to discard the syntax ORDER BY and save and it works fine too but the problem is it doesnt sort by Name.
The question :
1. Is it I can't use the syntax ORDER BY in View or something is wrong with my statement?
2. I dont understand the error message. Is it asking for extra clauses?
3. How do I need to change the statement in View in order to be able to sort by Name?
Hope someone out there can help me asap.
Thanks & Regards.
SELECT DISTINCT
NO, Name, IndexNumber, Type1, Type2, StockCode,
StockShortName, ISIN
FROM Entity
WHERE (Name IN
(SELECT Name
FROM Entity AS Tmp
GROUP BY Name
HAVING COUNT(*) > 1))
ORDER BY Name
I encounter this error message when I save :
"ODBC error : [Microsoft][ODBC][SQL Server Drive]]SQL Server]An ORDER BY clause is invalid in views, derived tables, and subqueries unless TOP is also specified."
I check the syntax using SQL Query Ananlyzer, it doesn't have any error and it works fine showing all the records Order By Name.
I tried to discard the syntax ORDER BY and save and it works fine too but the problem is it doesnt sort by Name.
The question :
1. Is it I can't use the syntax ORDER BY in View or something is wrong with my statement?
2. I dont understand the error message. Is it asking for extra clauses?
3. How do I need to change the statement in View in order to be able to sort by Name?
Hope someone out there can help me asap.
Thanks & Regards.