I am fairly new to SQL statements and I am trying to print units sold from a database. Under the units sold column it will not print the number it will just print "Units Sold". Any help would be greatly appreciated. Here is my code:
SELECT brand_name, brand_type, Round(avgprice,2) AS "Average Price", "Units Sold"
FROM lgbrand b
JOIN (
SELECT brand_id, Avg(prod_price) AS avgprice
FROM lgproduct
GROUP BY brand_id
) sub1 ON b.brand_id = sub1.brand_id
JOIN (
SELECT brand_id, Sum(line_qty) AS "Units Sold"
FROM lgproduct p
JOIN lgline l ON p.prod_sku = l.prod_sku
GROUP BY brand_id
) sub2 ON b.brand_id = sub2.brand_id
ORDER BY brand_name;