AnsweredAssumed Answered

SQL to sumarize same materials in tanks

Question asked by igreguri Champion on Mar 9, 2018
Latest reply on Mar 13, 2018 by igreguri

SQL to sumarize same materials in tanks

I would like by SQL query from PI database to make a overview amount (sum) of crude material in crude storages, total amount in tonns by crude name.

We have 7 crude storages, and process a lot of different raw materials. For that reason we want to know how much we have current actual raw materials.

 

PI Tags:

Quantities in tanks

Materials in tanks

RTA016MI.PV

RTA016.MATERIAL.MDE

RTA018MI.PV

RTA018.MATERIAL.MDE

RTA019MI.PV

RTA019.MATERIAL.MDE

RTA020MI.PV

RTA020.MATERIAL.MDE

RTA021MI.PV

RTA021.MATERIAL.MDE

RTA022MI.PV

RTA022.MATERIAL.MDE

RTA023MI.PV

RTA023.MATERIAL.MDE

 

Overview in AF:

pic1.jpg

 

Example (picture above):

In this case I want to know...

Crude                                           SUM (t)

SIR_AZERI_LIGHT                        ?

SIR_BASRAH_LIGHT                    ?             

SIR_MIX                                         ?

 

How to create SQL query for this?

Thanks,

Igor

Outcomes