24. Display the order number for all orders whose average
item cost is greater than the overall average item cost
across all orders.
Answers were Sorted based on User's Feedback
Answer / sarath
select ORDER_NO,AVG(ITEM_COST) from <TN>
Group by ORDER_NO
having AVG(ITEM_COST) > (Select Max(AVG(ITEM_COST)) from
<TN> Group by ORDER_NO)
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sarath
Small correction to the above answer. Its not MAX, but AVG
Sorry for the mistake
select ORDER_NO,AVG(ITEM_COST) from <TN>
Group by ORDER_NO
having AVG(ITEM_COST) > (Select AVG(AVG(ITEM_COST)) from
<TN> Group by ORDER_NO)
This is to display the Order no whose AVG is > Resultant AVG of All Order's AVG(ITEM _Cost)
Is This Answer Correct ? | 1 Yes | 1 No |
Define Normalization with example?
Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?
how to find out second largest value in the table
What query tells you how much space a tablespace named test is taking up, and how much space is remaining?
what is the syntax of UPDATE command?
I have a table that log salary-increase-process have fields: autoid, old_salary, acctno and table EMP: acctno, name, salary I want to list count increase-salary of employees, each have old_salary, new_salary. Help me with SELECT statement, please!
emp numb is unique because that is primary key,,but what is foreign key .. explain very clear with example
How to get last row id?
what is main def between plsql/table and array?
What a SELECT FOR UPDATE cursor represent.?
how to insert data into partitioned table partition done by Range partition
What is the data pump import utility?