Hi,

I want to create a function for use as below:

select Code, Description, My_NewFunc(Code) from producs order by Description

where My_NewFunc:
. receives each product code of in "ptoducts" table
. proccess a table T1 using the Code parameter to sum the column Quantity1 for the 
code passed as parameter
. proccess other table t2 using the same Code to sum the column Quantity2 for the same 
code
. result the value Quantity1 - Quantity2

A result set with this example may be as:

Code     Description    My_NewFunc(Code)
----     -----------    ----------------
3        Diskette       44
1        Micro          23
5        Monitor        35
7        Mouse          12
  
Thanks!

Reply via email to