Progress - Identificando registros unicos y diferrentes en consulta (DISTINCT)

 
Vista:

Identificando registros unicos y diferrentes en consulta (DISTINCT)

Publicado por Juan MAnuel Gzz (2 intervenciones) el 11/09/2014 18:35:45
Cua´l es el equivalente en progress a hacer un SELECT DISTINCT en SQL?
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
Imágen de perfil de xve

Identificando registros unicos y diferrentes en consulta (DISTINCT)

Publicado por xve (1 intervención) el 11/09/2014 19:02:41
Aqui lo tienes Juan Manuel...

http://knowledgebase.progress.com/articles/Article/000031694
The simplest code that does the same thing as a SELECT DISTINCT statement is the following:

1
2
3
4
FOR EACH SomeTable NO-LOCK WHERE SomeConditions BREAK BY SomeField:
    IF FIRST-OF(SomeField) THEN
        /* Do What You Want With The Record Here */
END.


If you need to implement DISTINCT for multiple fields thae you will need to change the code to something like the following:

1
2
3
4
FOR EACH SomeTable NO-LOCK WHERE SomeConditions BREAK BY SomeField1 BY SomeField2:
    IF FIRST-OF(SomeField1) AND FIRST-OF(SomeField2) THEN
        /* Do What You Want With The Record Here */
END.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Identificando registros unicos y diferrentes en consulta (DISTINCT)

Publicado por Juan MAnuel Gzz (2 intervenciones) el 18/09/2014 16:19:02
Gracias. Me ha servido.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar