0

I know that this Problem was addressed before but my SQL knowledge is not that good to figure it out. Maybe you can help me.

select 
    ProductionLine,
    Product, 
    POId, 
    BatchNumber, 
    Sum(Prime) as Prime, 
    Sum(Offspec) as OffSpec, 
    Sum(InQ) as InQ, 
    Sum(Prime) + Sum(Offspec) + Sum(InQ) as Total


from @t2 

group by 
    ProductionLine, 
    BatchNumber, 
    POId, 
    Product;

I now need a Column PercentagePrime where the column Prime is defined by the alias Total

Akina
  • 20,750
  • 2
  • 20
  • 22
Pascal Sparla
  • 3
  • 1
  • 1
  • 2

0 Answers0