I am new at this and struggling, I have these three statements that work independently, but I need to put them all together into one so that I can get the output that I desire. I appreciate any help that anyone can give me.
SELECT uvb.item_number,
COUNT(uvb.item_number) as cases_scanned
FROM t_uv_barcode uvb
WHERE uvb.barcode_uom = 'CASE' AND uvb.barcode LIKE '%C'
GROUP BY uvb.item_number
SELECT uvb.item_number,
COUNT(uvb.barcode) as cases_sold
FROM t_uv_barcode uvb
WHERE uvb.barcode_uom = 'CASE'
GROUP BY uvb.item_number
SELECT uv.item_number,
SUM(uv.qty_needed) as units_sold, SUM(uv.qty_scanned) as units_scanned
FROM t_order o (NOLOCK)
INNER JOIN t_uv_barcode_listener uv (NOLOCK)
ON o.order_number = uv.order_number
GROUP BY uv.item_number
ORDER BY uv.item_number
SELECT uvb.item_number,
COUNT(uvb.item_number) as cases_scanned
FROM t_uv_barcode uvb
WHERE uvb.barcode_uom = 'CASE' AND uvb.barcode LIKE '%C'
GROUP BY uvb.item_number
SELECT uvb.item_number,
COUNT(uvb.barcode) as cases_sold
FROM t_uv_barcode uvb
WHERE uvb.barcode_uom = 'CASE'
GROUP BY uvb.item_number
SELECT uv.item_number,
SUM(uv.qty_needed) as units_sold, SUM(uv.qty_scanned) as units_scanned
FROM t_order o (NOLOCK)
INNER JOIN t_uv_barcode_listener uv (NOLOCK)
ON o.order_number = uv.order_number
GROUP BY uv.item_number
ORDER BY uv.item_number