Ciao ragazzi. Per la prima volta mi capita di dover fare una query del tipo: SELECT Campo1 FROM
tabella, SELECT Campo2 FROM tabella2 ORDER BY Campo1 + Campo2.
Quale sarebbe la sintassi corretta?
grazie
Ciao ragazzi. Per la prima volta mi capita di dover fare una query del tipo: SELECT Campo1 FROM
tabella, SELECT Campo2 FROM tabella2 ORDER BY Campo1 + Campo2.
Quale sarebbe la sintassi corretta?
grazie
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
Ho due tabelle:
Utente: coi campi Nick e Crediti
Banca: coi campi Nome e Crediti
devo stampa tutti i Nick di Utente ordinandoli per il campo Crediti + Crediti della seconda tabella(ovviamente i crediti + crediti avviene se Nick = Nome)
ESEMPIO PRATICO
nella tabella uno c'è Antonio 1000, Francesco 500, Andrea 35
nella tabella due Antonio 100, Andrea 200
la query stamperà
1)Antonio 1100
2)Francesco 500
3)Andrea 235
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
SELECT Nome,(Utente.Crediti + Banca.Crediti) AS Crediti FROM Utente,Banca WHERE Utente.nick = Banca.Nome
Dovrebbe andare..
dimenticavo l'ordinamento....
SELECT Nome,(Utente.Crediti + Banca.Crediti) AS Crediti FROM Utente,Banca WHERE Utente.nick = Banca.Nome ORDER BY Crediti DESC
purtroppo non solo non va, ma se un utente non c'è anche in Banca non viene stampato proprio.
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
nella tabella utenti ho:
Antonio 7000, Andrea 1000
in quella banca ho:
Antonio 100, Antonio 200, Antonio 50, Andrea 200
MI STAMPA:
Antonio 7000
Antonio 7000
Antonio 7000
Andrea 1000
Andrea 1000
INVECE DOVREBBE STAMPARMI:
Antonio 7350
Andrea 1250
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
ragazzi state dimenticando la clausola Group By.
codice:Select nick, (b.crediti + u.crediti) as Tot from banca b, utente u where u.nick = b.nome GROUP BY nick Order by Tot DESC
resta il problema che non mi stampa gli altri utenti, quelli che non sono presenti in bancaOriginariamente inviato da xxxAlex83xxx
ragazzi state dimenticando la clausola Group By.
codice:Select nick, (b.crediti + u.crediti) as Tot from banca b, utente u where u.nick = b.nome GROUP BY nick Order by Tot DESC
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made