Numero di riga in una SELECT PDF Stampa E-mail
Scritto da Michael   
Giovedì 16 Ottobre 2008 16:32
Quante volte vi è capitata l'esigenza di avere un numero progressivoin una query di selezione? E sono convinto che se avete provato a chiedere su qualche forum c'è stato il furbone che vi ha snocciolato l'ennesima perla sui campi auto-incrementali... MA NON E' QUELLO CHE SERVE A VOI! Destination host forbidden
Il sunto è passare da una query come questa:



ad una query come questa


COME FARE?!?!

ecco la differenza tra le due query:


select pagamento from _clienti 
group by (pagamento) having pagamento is not null and pagamento<>'' 
order by pagamento

SELECT ROW_NUMBER() OVER (ORDER BY pagamento) AS Row,pagamento from _clienti 
group by (pagamento) having pagamento is not null and pagamento<>'' 
order by pagamento

tutto qui :-)

Commenti
Nuovo Cerca
+/-
Commenta
Nome:
Email:
 
Website:
Titolo:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:):grin;)8):p:roll:eek:upset:zzz:sigh:?:cry
:(:x
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."