SQL count number of groups
Yes, use DISTINCT
select count(distinct pallet) as pallets,
sum(qty) as total,
count(*) as totalItems
from your_table
Yes, use DISTINCT
select count(distinct pallet) as pallets,
sum(qty) as total,
count(*) as totalItems
from your_table