Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
cli:franke:competition [2018/06/13 18:08] f.zoppini |
cli:franke:competition [2018/06/13 18:09] (current) f.zoppini [Configurazioni aggiuntive database] |
||
|---|---|---|---|
| Line 51: | Line 51: | ||
| ALTER TABLE ONLY public.thresholds | ALTER TABLE ONLY public.thresholds | ||
| ADD CONSTRAINT uq_codubi_codturnidet UNIQUE (codubi, codturnidet); | ADD CONSTRAINT uq_codubi_codturnidet UNIQUE (codubi, codturnidet); | ||
| + | </ | ||
| + | |||
| + | ==== Esempio estrazione dati per configurazione soglie ==== | ||
| + | <code sql> | ||
| + | select ubicaz.codice, | ||
| + | concat_pipe(ubicaz.codturno||';' | ||
| + | from ubicaz | ||
| + | left join ubicaz u2 on ubicaz.codubib = u2.codice | ||
| + | left join turni on ubicaz.codturno = turni.codice | ||
| + | join turnidet on turni.codice = turnidet.codturno | ||
| + | left join thresholds on ubicaz.codice = thresholds.codubi and turnidet.codice = thresholds.codturnidet | ||
| + | where ubicaz.tiposet = ' | ||
| + | group by ubicaz.codice, | ||
| + | order by ubicaz.codice, | ||
| </ | </ | ||