Help Please, working with AVG
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Help Please, working with AVG Expand / Collapse
Author
Message
Posted 3/6/2008 2:53:46 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/11/2008 1:45:21 PM
Posts: 4, Visits: 12
Hi all,

I am trying to do a statement equivalent to the following one from Oracle;


SELECT DISTINCT A.EMPLOYEE_NBR
FROM EMPLOYEE_POSITION A, EMPLOYEE_POSITION_CTRL B
WHERE (SELECT AVG(SALARY) FROM EMPLOYEE_POSITION) > ((SELECT AVG(SALARY) FROM EMPLOYEE_POSITION_CTRL) * .05)+ (SELECT AVG(SALARY) FROM EMPLOYEE_POSITION_CTRL)
OR (SELECT AVG(SALARY) FROM EMPLOYEE_POSITION) < ((SELECT AVG(SALARY) FROM EMPLOYEE_POSITION_CTRL)-(SELECT AVG(SALARY) FROM EMPLOYEE_POSITION_CTRL) * .05)

Basically I am trying to determine if the AVG of salary in table A is within 5 percent of table B. It works for all other db's but in TD i get errors and i've tried different things with no luck. The datatype is Float. If somebody could help me i would sincerely appreciate it, were turning our wheels here. For more info or to contact me directly please respond to this post.
Post #10826
Posted 3/21/2008 11:42:01 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 6/27/2008 7:19:28 AM
Posts: 42, Visits: 54
Are you sure about your code ?
I don't see any reference to A or B alias in the WHERE clause.
Post #10999
Posted 3/21/2008 5:52:32 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 9/4/2008 11:27:02 PM
Posts: 64, Visits: 75
You posed the very same question on 3/6 and it was answered to your satisfation. Why are you asking the same questin again?

http://www.teradata.com/teradataForum/Topic10827-9-1.aspx
Post #11006
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 5:15pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 10 queries. Compression Disabled.