Subject | Aggregate UDF |
---|---|
Author | Gamboa Quinde Milton Eduardo |
Post date | 2004-02-27T22:27:23Z |
Hello everybody.
I have a table which contains the following data:
DOCUMENT ACCESS
1 1
2 1
3 1
1 2
2 1
3 2
1 3
If I use the sentence "SELECT DOCUMENT, SUM(ACCESS) FROM TABLE" I get:
DOCUMENT ACCESS
1 6
2 2
3 3
And if I use "SELECT DOCUMENT, SUM(DISTINCT ACCESS) FROM TABLE" I get:
DOCUMENT ACCESS
1 6
2 1
3 3
But I need a way to obtain a bitwise addition instead of the arithmetical addition. (bitwise OR).
Something like this: "SELECT DOCUMENT, BIT_OR(ACCESS) FROM TABLE"
DOCUMENT ACCESS
1 3
2 1
3 3
Does anyone know how to do this or how to write an aggregate UDF in Delphi/Kylix to accomplish it?
Please your help.
Thanks in advance.
Saludos,
Eduardo Gamboa
(Ecuador)
---------------------------------------------------------------------------------------------------
Nota de descargo: La información contenida en este e-mail es confidencial y sólo puede ser utilizada por el individuo o la compañía a la cual está dirigido. Esta información es de carácter provisional y referencial, no debe ser distribuida ni copiada total o parcialmente por ningún medio sin la autorización del BANCO DEL PICHINCHA C.A. El Banco no asume responsabilidad sobre información, opiniones o criterios contenidos en este e-mail.
Disclaimer: The information container in this e-mail is confidential and intended only for the use of the person or company to which it is addressed. This information is considered provisional and referential; it can not be totally or partially distributed nor copied by any media without the authorization from BANCO DEL PICHINCHA C.A. The Bank does not assume responsibility about this information, opinions or criteria contented in this e-mail.
---------------------------------------------------------------------------------------------------
I have a table which contains the following data:
DOCUMENT ACCESS
1 1
2 1
3 1
1 2
2 1
3 2
1 3
If I use the sentence "SELECT DOCUMENT, SUM(ACCESS) FROM TABLE" I get:
DOCUMENT ACCESS
1 6
2 2
3 3
And if I use "SELECT DOCUMENT, SUM(DISTINCT ACCESS) FROM TABLE" I get:
DOCUMENT ACCESS
1 6
2 1
3 3
But I need a way to obtain a bitwise addition instead of the arithmetical addition. (bitwise OR).
Something like this: "SELECT DOCUMENT, BIT_OR(ACCESS) FROM TABLE"
DOCUMENT ACCESS
1 3
2 1
3 3
Does anyone know how to do this or how to write an aggregate UDF in Delphi/Kylix to accomplish it?
Please your help.
Thanks in advance.
Saludos,
Eduardo Gamboa
(Ecuador)
---------------------------------------------------------------------------------------------------
Nota de descargo: La información contenida en este e-mail es confidencial y sólo puede ser utilizada por el individuo o la compañía a la cual está dirigido. Esta información es de carácter provisional y referencial, no debe ser distribuida ni copiada total o parcialmente por ningún medio sin la autorización del BANCO DEL PICHINCHA C.A. El Banco no asume responsabilidad sobre información, opiniones o criterios contenidos en este e-mail.
Disclaimer: The information container in this e-mail is confidential and intended only for the use of the person or company to which it is addressed. This information is considered provisional and referential; it can not be totally or partially distributed nor copied by any media without the authorization from BANCO DEL PICHINCHA C.A. The Bank does not assume responsibility about this information, opinions or criteria contented in this e-mail.
---------------------------------------------------------------------------------------------------