By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,197 Members | 974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,197 IT Pros & Developers. It's quick & easy.

Looking for some help on a simple command....

P: n/a
(Im a newbie at oracle)
I have a field in my database called "gamesplayed" and I would like that to
display the total of 'opwin' & 'oplost' automatically. Sort of like adding a
formula to a field in excel, but I cant figure out how to do this or if its
even possible.

example:

'opwin' 9
'oplost' 19
'gamesplayed' 28 (i would like this field to update automatically)
I am thinking I just add the command "select sum(opwin+oplost) from
gametable;" to 'gamesplayed', but how?
Andrew
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

<mo***@hotmail.com> wrote in message
news:Yb****************@read1.cgocable.net...
(Im a newbie at oracle)
I have a field in my database called "gamesplayed" and I would like that to display the total of 'opwin' & 'oplost' automatically. Sort of like adding a formula to a field in excel, but I cant figure out how to do this or if its even possible.

example:

'opwin' 9
'oplost' 19
'gamesplayed' 28 (i would like this field to update automatically)
I am thinking I just add the command "select sum(opwin+oplost) from
gametable;" to 'gamesplayed', but how?
Andrew


You can create a view or use the sql:

select opwin, oplost, (opwin+oplost) gamesplayed from gametable;

Unless you built the table with the " around the field names you don't need
them.

Jim
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.