I am using TOAD Data Point as my access/query tool for my company's databases within the Teradata RDMS. I have used the 'TOAD Views' functionality to create a VIEW to avoid having to re-write the SQL each time I want to use my more common queries. My queries that I run straight from the 'SQL Editor' or the 'Query Builder' windows within TOAD run with no problems, but when I place the SQL within 'TOAD Views', I get the following error:
[Teradata Database]  Syntax error: ORDER BY is not allowed in subqueries.
Here is the SQL I'm attempting to run (again, which runs fine from the 'SQL Editor' or the 'Query Builder' windows within TOAD:
select g.groupdn from ad_Grp g
left join ad_grp_member gm
on g.groupdn=gm.groupdn and g.as_of_dt=gm.as_of_dt
where gm.groupdn is null
and g.as_of_dt='2017-03-02 00:00:00'
and g.groupdn like '%DC=ABCDomain%'
order by 1
Why won't this simple SQL statement run from within the 'TOAD Views' functionality as it accesses my Teradata RDMS?
Solved! Go to Solution.
ORDER BY is not allowed in Teradata views.
Hi Todd - I have read about that restriction in other postings, but I am able to run the above query successfully from the 'Query Editor/Builder'. Does that make sense?