Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
cli:franke:shared_data [2018/08/27 14:00] f.zoppini [Database access: technical information] |
cli:franke:shared_data [2018/08/27 14:01] (current) f.zoppini [Sample queries] |
||
|---|---|---|---|
| Line 76: | Line 76: | ||
| Produced items on June 18th 2018 with date, time, unique identifier, production resource description, | Produced items on June 18th 2018 with date, time, unique identifier, production resource description, | ||
| <code sql> | <code sql> | ||
| - | SELECT DATA, ora, codlot, prodline.descrizio AS linea, prodline.descrep, | + | SELECT DATA, ora, codlot, prodline.descrizio AS linea, prodline.descrep, |
| - | 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=' | WHERE DATA=' | ||
| 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, | + | select data, unitprod.dart, |
| - | 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=' | where regprod.codubi=' | ||
| 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, | 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, | ||
| <code sql> | <code sql> | ||
| - | select data, ora, tmdiff/60 as dtm, tipoevento, qcausafm.descrizio as dfermo, qcausafm.tipofm, | + | select data, ora, tmdiff/60 as dtm, tipoevento, qcausafm.descrizio as dfermo, qcausafm.tipofm, |
| - | inner join sharedprod.qcausafm on sharedprod.qcausafm.codice=regfm.caufm | + | inner join shareddata.qcausafm on shareddata.qcausafm.codice=regfm.caufm |
| where codubi=' | where codubi=' | ||
| order by tm | order by tm | ||
| </ | </ | ||