cli:franke:shared_data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cli:franke:shared_data [2018/08/27 13:51]
f.zoppini [Quering samples]
cli:franke:shared_data [2018/08/27 14:01] (current)
f.zoppini [Sample queries]
Line 6: Line 6:
 ^ODBC Driver | [[https://ftp.postgresql.org/pub/odbc/versions/msi/psqlodbc_09_03_0300-1.zip|32bit]], [[https://ftp.postgresql.org/pub/odbc/versions/msi/psqlodbc_09_03_0300-x64-1.zip|64bit]] | ^ODBC Driver | [[https://ftp.postgresql.org/pub/odbc/versions/msi/psqlodbc_09_03_0300-1.zip|32bit]], [[https://ftp.postgresql.org/pub/odbc/versions/msi/psqlodbc_09_03_0300-x64-1.zip|64bit]] |
 ^Database name|andon_FWK| ^Database name|andon_FWK|
-^Database schema|sharedprod|+^Database schema|shareddata|
 ^Username| michael.lehmann (readonly)| ^Username| michael.lehmann (readonly)|
 ^Password| Swh2Rj6Q| ^Password| Swh2Rj6Q|
Line 76: Line 76:
 Produced items on June 18th 2018 with date, time, unique identifier, production resource description, department description, article code (model) and work order, sorted by event time epoch Produced items on June 18th 2018 with date, time, unique identifier, production resource description, department description, article code (model) and work order, sorted by event time epoch
 <code sql> <code sql>
-SELECT DATA, ora, codlot, prodline.descrizio AS linea, prodline.descrep, unitprod.dart, unitprod.procord FROM sharedprod.regprod  +SELECT DATA, ora, codlot, prodline.descrizio AS linea, prodline.descrep, unitprod.dart, unitprod.procord FROM shareddata.regprod  
-INNER JOIN sharedprod.prodline ON prodline.codice=sharedprod.regprod.codubi +INNER JOIN shareddata.prodline ON prodline.codice=shareddata.regprod.codubi 
-INNER JOIN sharedprod.unitprod ON unitprod.codice=sharedprod.regprod.codlot+INNER JOIN shareddata.unitprod ON unitprod.codice=shareddata.regprod.codlot
 WHERE DATA='20180618' WHERE DATA='20180618'
 ORDER BY tm ORDER BY tm
Line 84: Line 84:
 Count produced items after June 18th 2018 (included) grouped by day, article code and work order on production resource 821102A (DMG LB) Count produced items after June 18th 2018 (included) grouped by day, article code and work order on production resource 821102A (DMG LB)
 <code sql> <code sql>
-select data, unitprod.dart, unitprod.procord, sum(qta) as pezzi from sharedprod.regprod +select data, unitprod.dart, unitprod.procord, sum(qta) as pezzi from shareddata.regprod 
-inner join sharedprod.unitprod on sharedprod.unitprod.codice=sharedprod.regprod.codlot+inner join shareddata.unitprod on shareddata.unitprod.codice=shareddata.regprod.codlot
 where regprod.codubi='821102A' and regprod.data>='20180618' where regprod.codubi='821102A' and regprod.data>='20180618'
 group by data, dart, procord group by data, dart, procord
Line 91: Line 91:
 Get the DMG LB (821102A) downtime events list from 06:00 to 14:00 of June 18th 2018 with date, time, duration in minutes, event type, downtime cause description, downtime kind, changeover time flag Get the DMG LB (821102A) downtime events list from 06:00 to 14:00 of June 18th 2018 with date, time, duration in minutes, event type, downtime cause description, downtime kind, changeover time flag
 <code sql> <code sql>
-select data, ora, tmdiff/60 as dtm, tipoevento, qcausafm.descrizio as dfermo, qcausafm.tipofm, qcausafm.setup from sharedprod.regfm +select data, ora, tmdiff/60 as dtm, tipoevento, qcausafm.descrizio as dfermo, qcausafm.tipofm, qcausafm.setup from shareddata.regfm 
-inner join sharedprod.qcausafm on sharedprod.qcausafm.codice=regfm.caufm+inner join shareddata.qcausafm on shareddata.qcausafm.codice=regfm.caufm
 where codubi='821102A' and data='20180618' and ora>='06:00' and ora<='14:00' where codubi='821102A' and data='20180618' and ora>='06:00' and ora<='14:00'
 order by tm order by tm
 </code> </code>
  • cli/franke/shared_data.1535370695.txt.gz
  • Last modified: 2018/08/27 13:51
  • by f.zoppini