|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Sep 2003
Città: Modena
Messaggi: 4125
|
informatici: interrogazioni SQL
ho il seguente schema
PERSONA (CF,NOME,COGNOME) CF PRIMARY KEY AMBITO (ID,NOME,CF-RESP) ID PRIMARY KEY, FK CF-RESP REFERENCES PERSONA TIPODOC (CODICE,DESC_IT,DESC_UK,ID_AMBITO) PRIMARY KEY CODICE ID_AMBITO REFERENCES AMBITO DOCUMENTO (ID,TITOLO,DATACREAZIONE,CODTIPO) PRIMARY KEY ID CODTIPO REFERENCES TIPODOC devo selezionare il numero di documenti perc ciascun tipo creati prima del 2003. GRAZIE!! |
![]() |
![]() |
![]() |
#2 | |
Senior Member
Iscritto dal: Aug 2000
Messaggi: 17963
|
Re: informatici: interrogazioni SQL
Quote:
dove x selezioni il tipo che ti interessa
__________________
. |
|
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Jan 2001
Città: Milano
Messaggi: 5707
|
select count(doc.id), desc_it from documento doc, tipo_doc where cod_tipo=codice and datacreazione<'20030101000000' group by desc_it
il formato data dipende dal DB |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Sep 2003
Città: Modena
Messaggi: 4125
|
io devo avere una tabella con il tipo ed il numero di documenti che ci sono. Come se dovessi fare un for di quello che hai fatto tu
|
![]() |
![]() |
![]() |
#5 | |
Senior Member
Iscritto dal: Jan 2001
Città: Milano
Messaggi: 5707
|
Quote:
adatta al tuo db quello che ho scritto ![]() |
|
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Sep 2003
Città: Modena
Messaggi: 4125
|
grazie cerco di capirla.
|
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Jan 2002
Città: dans la Vaunage
Messaggi: 2213
|
ma siete anche voi dei DBA??
![]()
__________________
"Sometimes you have to roll the hard six!!" Low lie the fields of Athenry, Where once we watched the small free birds fly. Our love was on the wing, We had dreams and songs to sing. Nothing matters, Mary, when you're free |
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Sep 2003
Città: Modena
Messaggi: 4125
|
per dba intendi database access? Cmq è un'esamino che ho a ing meccanica, l'ho già passato ma con 18. vorrei migliorare visto che ho saputo che per fare la specialistica c'è bisogno di una soglia di voto minima
|
![]() |
![]() |
![]() |
#9 | |
Senior Member
Iscritto dal: Jan 2002
Città: dans la Vaunage
Messaggi: 2213
|
Quote:
no intendo Database Administrator tecnico amministratore database ( 90% oracle ) fato corso l'anno scorso ( è il primo di questo tipo in Piemonte e secondo in Italia se non sbaglio ), sovvenzionato da regione, provincia, comune di torino e riconosciuto a livello europeo ![]() appena finisco sto kazz di servizio civile spero di trovare un posto ![]()
__________________
"Sometimes you have to roll the hard six!!" Low lie the fields of Athenry, Where once we watched the small free birds fly. Our love was on the wing, We had dreams and songs to sing. Nothing matters, Mary, when you're free |
|
![]() |
![]() |
![]() |
#10 |
Senior Member
Iscritto dal: Aug 2001
Città: milano, qualunque birreria
Messaggi: 4208
|
oppure crea una bella vista logica...
![]() ![]() ![]() dba? mah, forse... ![]() ![]() ![]()
__________________
Save water: drink beer.
This message has been created with 100% recycled electrons Un rutto vale più di mille parole. |
![]() |
![]() |
![]() |
#11 |
Member
Iscritto dal: May 2003
Città: Saronno
Messaggi: 161
|
DBA = data base administrator.
Guarda che sei nel forum sbagliato. Nel forum "programmazione" ci sono diversi threads che parlano di sql e di database, e diverse persone che possono darti un aiuto. |
![]() |
![]() |
![]() |
#12 | |
Senior Member
Iscritto dal: Jan 2002
Città: dans la Vaunage
Messaggi: 2213
|
Quote:
nooooooooo aborro le viste! ![]() a parte gli scherzi, viste ed indici falle SOLO quando hai tanti record, ma tanti! (e parlo di decine migliaia ). Allora lì un bel tablespace index con viste, flags ed altra robetta e sei apposto ![]() cmq vero ciò che dice zak , c'è una sez apposta magari chiedi ad un mod di farlo spostare sto thread ![]()
__________________
"Sometimes you have to roll the hard six!!" Low lie the fields of Athenry, Where once we watched the small free birds fly. Our love was on the wing, We had dreams and songs to sing. Nothing matters, Mary, when you're free |
|
![]() |
![]() |
![]() |
#13 | |
Senior Member
Iscritto dal: Sep 2003
Città: Modena
Messaggi: 4125
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#14 |
Senior Member
Iscritto dal: Sep 2003
Città: Modena
Messaggi: 4125
|
ehy ragazzi grazie di cuore!
|
![]() |
![]() |
![]() |
#15 | |
Senior Member
Iscritto dal: Jan 2002
Città: dans la Vaunage
Messaggi: 2213
|
Quote:
ma va dai ![]()
__________________
"Sometimes you have to roll the hard six!!" Low lie the fields of Athenry, Where once we watched the small free birds fly. Our love was on the wing, We had dreams and songs to sing. Nothing matters, Mary, when you're free |
|
![]() |
![]() |
![]() |
#16 | |
Senior Member
Iscritto dal: Jan 2001
Città: Milano
Messaggi: 5707
|
Quote:
la vista e' qualcosa di applicativo (o meglio creata per soddisfare le esigenze applicative) e non riguarda il numero di record. gli indici poi andrebbero previsti in fase di progettazione della base dati e non creati qua e la' perche' il db e' lento ![]() |
|
![]() |
![]() |
![]() |
#17 | |
Senior Member
Iscritto dal: Jan 2002
Città: dans la Vaunage
Messaggi: 2213
|
Quote:
Gli indici, come ogni progetto, si discutono a priori su carta o al massimo a grandi linee con erwin. Solo che quando hai da fare create, alter & uptade table è logico che di nuovi indici devono essere creati "a caldo", quindi quando ormai sei "in produzione" va bhe, torno a vendere tessere cinema ![]()
__________________
"Sometimes you have to roll the hard six!!" Low lie the fields of Athenry, Where once we watched the small free birds fly. Our love was on the wing, We had dreams and songs to sing. Nothing matters, Mary, when you're free |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 07:59.