For each pizza, display its count of rows in Stock
followed by all its columns in Product.
ストックテーブル
s_inv - Text - foreign key to Product
s_num
s_in_stock
製品表
p_inv - Text - Primary Key
p_name
p_price
コードを変更して、これを試してください。
select p.p_inv,p.p_namep.p_price,count(select * from stock where s.s_inv=p.p_inv) from product p, stock s;
SQL サーバーで:
select p.p_inv,
p.p_name,
p.p_price,
s.s_num,
s.s_in_stock,
count(select * from product p,stock s where p.p_inv=s.s_inv)
as rows_count
from product p
join stock s on p.p_inv=s.s_inv
order by p.s_inv;