表A  product 产品资料表
字段:productid | productname|price 等等表B  stockin 入库记录表
字段:productid | num | money | man | time等等字段在入库表中我都是只记录了产品ID productid,但我想实现查询入库记录表中某产品的历史入库记录的话,想输入产品名称查询,应该如何写SQL语句?
select * from product a right join stockin b on a.productid = b.productid 
where .........