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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

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

    (Im a newbie at oracle)


    I have a field in my database called "gamesplaye d" 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+oplos t) from
    gametable;" to 'gamesplayed', but how?


    Andrew


  • Jim Kennedy

    #2
    Re: Looking for some help on a simple command....


    <mooxe@hotmail. comwrote in message
    news:Yb9rc.2770 $_V4.609@read1. cgocable.net...
    (Im a newbie at oracle)
    >
    >
    I have a field in my database called "gamesplaye d" 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+oplos t) 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


    Comment

    Working...