You may want to checkt the datatype on your datetime column since I believe Oracle stores its dates and timestamps differently than DB2.
Otherwise, the angelic one's solution looks good.
HTH,
DaveSlash
Main Topics
Browse All TopicsI have a column in oracle that I am using to create a query and this column has value
sum(user_count + data_count)/300 when application reads this query it will use to create the following query
select sum(user_count + data_count) as count_per_sec,datetime from tableA group by datetime
where datetime >='2009-01-00.00.00' and datetime < '2009-02-01-00.00.00'
Now I need to get the max value from the datetime period and I dont want to change the query that reads the custom column from oracle what value then should I need to change the column that will reflect the max value ?
I tried to change the column as max(sum(user_count + data_count)/300 ) as max_value but I got the error when I ran the query in db2
SQL0112N The operand of the column function "MAX" includes a column function,
a scalar fullselect, or a subquery. SQLSTATE=42607
Let me know how to resolve this?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
custom column in oracle can take only column_names and db2 query that is written from this custom column in oracle already does sum (custom_column from oracle), I dont think I can write a full query and db2 can consume and change that data..
I need to structure this as
select max(a.conn) from
( select sum(user_count + data_count) as conn from.....
I cannot do all this in custom column where it can take only the column that needs to be summed up.. let me know any altaernatives..
Business Accounts
Answer for Membership
by: angelIIIPosted on 2009-03-30 at 14:33:20ID: 24023608
you need a subquery
Select allOpen in new window