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 |
Please explain joins in oracle?
Hi how Can I Add A Foreign key that references a table that has composit primary key ? example i had costumer table that has C_Id and SSN Both as PK and another table has C_Id that must refernece C_Id in Customers i done the usual way and got oracle error message about uniqeness any ideas plz
What are inner join and outer join?
Table E: Name dept month sal 1 A JAN 800 2 B APR 1000 3 A JAN 300 4 A JAN 600 5 C JUN 400 1) SELECT HIGHEST SAL PAID DEPT IN JAN MONTH? 2) WRITE QUERY GET MAX SAL DEPT NO?
How to create a new user account in oracle?
What is rich query?
How many anonymous blocks can be defined?
how to i write the query 'NISHI' TO N I S H I
4 Answers Attra, Metric Stream,
What is an Oracle view?
What is recovery manager in Oracle?
How to drop a tablespace?
The join defined by the default data link is an outer join yes or no ?