|
|
|
Forum 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.
|
|
|
|
|
Forum 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.
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: 6/25/2008 7:48:49 PM
Posts: 60,
Visits: 67
|
|
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
|
|
|
|