report using join condition [message #496746] |
Wed, 02 March 2011 04:05 |
|
maddyd2k
Messages: 24 Registered: November 2010
|
Junior Member |
|
|
Create a Report based on Join Conditions.
Eg.
1st Query : Select * from Emp
2nd Query : Select * from Dept
Join the Relation from 1st Query to Second Query
Apply following conditions:
a) if comm is null then hide the corresponding row
b) If sal is greater than average salary of there dept the display above average else display below average in the place holder column.
How can i do this???
|
|
|
|
|
Re: report using join condition [message #496772 is a reply to message #496754] |
Wed, 02 March 2011 06:45 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Why do you think you have to have SAL in DEPT group? Salaries belong to employees, they are in EMP group. (By the way, note that "SELECT *" is not a good way to write code - always specify all columns you are selecting, one by one, such as "SELECT ename, sal, comm FROM ...").
As of "average salary" or "total salary" or "number of employees", you need to create a summary column, specify function you'd like to use, break group and - that's it. That summary column is to be located in EMP group as well.
|
|
|