help: simple query!(菜鸟上路)# Database - 数据库
y*l
1 楼
write a query to display the number of products, the total product
quantity,highest&lowest value,but the average only for non-continued
products(product status is null).
I wrote like this:
SELECT COUNT(*)'prodNumberOfRows', SUM(prodQtyInv)'prodQtyInvAmount',
MAX(prodQtyInv)'prodhighestQtyInv', MIN(prodQtyInv)'prodLowestQtyInv',
AVG(prodQtyInv)'prodAvgQtyInv'
FROM Product
WHERE prodStatus is null;
However, it turns out that all the results are restricted to the "null"
quantity,highest&lowest value,but the average only for non-continued
products(product status is null).
I wrote like this:
SELECT COUNT(*)'prodNumberOfRows', SUM(prodQtyInv)'prodQtyInvAmount',
MAX(prodQtyInv)'prodhighestQtyInv', MIN(prodQtyInv)'prodLowestQtyInv',
AVG(prodQtyInv)'prodAvgQtyInv'
FROM Product
WHERE prodStatus is null;
However, it turns out that all the results are restricted to the "null"