Need advise implementing Sql Query
Moderators: chulett, rschirm, roy
Need advise implementing Sql Query
I am to create server job for the query: Select empno from emp where salary >avg(salary).. Please let me know
And do what with the result? Write it to another table, a text file, ftp to a mainframe, what? From what database, Oracle, UDB, SQL-Server, using what stage, OCI, ODBC, etc? Do you want user-defined or generated queries?
Your request is one of the first things you do in training. If you haven't had training, might I suggest using the tutorial?
Your request is one of the first things you do in training. If you haven't had training, might I suggest using the tutorial?
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
Re: Sql Query
![Laughing :lol:](./images/smilies/icon_lol.gif)
Add a drs stage and add the column, table and where condition.
vinod111 wrote:I am to create server job for the query: Select empno from emp where salary >avg(salary).. Please let me know
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is actually not possible in a single query. You need two passes through the data. You can do this with a nested query in the WHERE clause.
Code: Select all
column > (select avg(column) from table)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.