select a.date,a.name,a.product,d.qty,b.price from t_cust a,t_price b where a.date='0000-00-00' and a.product = b.product
group by a.name