SQL - anidar DISTINCT CON COUNT

 
Vista:

anidar DISTINCT CON COUNT

Publicado por rafael (4 intervenciones) el 11/10/2009 01:42:59
se puede anidar DISTINCT con COUNT o SUM??

algo asi

select Distinct (vale), COUNT (vale) as cantidad FROM recibo WHERE fecha = '05/10/2009'

ES QUE quiero primero filtrar los repetidos y despues contar cuantos vales diferentes hay, algo asi

si tengo

0021
0021
0022
0023
0023
0024

entonces el resultado de la expresion (cantidad) seria 4,
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder