10 lines
420 B
MySQL
10 lines
420 B
MySQL
|
/*3Write a SQL query to display the average price of items of each company, showing the name of the company.*/
|
||
|
SELECT A.pro_name, A.pro_price, F.com_name
|
||
|
FROM item_mast A INNER JOIN company_mast F
|
||
|
ON A.pro_com = F.com_id
|
||
|
AND A.pro_price =
|
||
|
(
|
||
|
SELECT MAX(A.pro_price)
|
||
|
FROM item_mast A
|
||
|
WHERE A.pro_com = F.com_id
|
||
|
);
|