-1
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
4

2 に答える 2

0

コードを変更して、これを試してください。

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;
于 2013-10-23T04:03:42.160 に答える
0

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;
于 2013-10-23T04:20:18.237 に答える