View previous topic :: View next topic
|
Author |
Message |
pardhasaradhireddy
New User
Joined: 20 May 2008 Posts: 8 Location: Hyderabad
|
|
|
|
i am selecting 10 fields from a table .
can i use divide operator in select statemnt for caluculating the resultant filed which is not a column of the table, but the fileds paticipating in the divide operator are present in the table.
let's say
PAID-AMOUNT-PER-UNIT =C-LI-CLC-ALLW-AMT/C-LI-ALLOW-UNT-NUM
Here C-LI-CLC-ALLW-AMT, C-LI-ALLOW-UNT-NUM are fileds of a table but
PAID-AMOUNT-PER-UNIT is not a filed of this table or any other table. can i do the above operation in the select statement |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
pardhasaradhireddy,
Yes, we can do arithmetic operations using different columns of a table and name the resultant column provided the operand column definitions are of numeric type. |
|
Back to top |
|
|
pardhasaradhireddy
New User
Joined: 20 May 2008 Posts: 8 Location: Hyderabad
|
|
|
|
how can u reply me with sample code |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you build a prototype query with the operations you want to accomplish and we can help you get it running if there are problems.
When you post your code, please use the "Code" tag at the top of the reply panel for readability (green on black) as well as preserve alignment. Use Preview to see how your post will appear to the forum and when you are satisfied with the appearance, Submit. |
|
Back to top |
|
|
umasankarmf
New User
Joined: 08 Sep 2008 Posts: 43 Location: india
|
|
|
|
Hi pardhasaradhireddy,
You can use the following query.
select C-LI-CLC-ALLW-AMT/C-LI-ALLOW-UNT-NUM as PAID-AMOUNT-PER-UNIT from TAB_NAME
The name which is using after AS is only for display purpose.
If any corrections ............... well come.....
Regards
Umasankar M |
|
Back to top |
|
|
pardhasaradhireddy
New User
Joined: 20 May 2008 Posts: 8 Location: Hyderabad
|
|
|
|
thank you |
|
Back to top |
|
|
|