Is this Possible

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick Truscott

    #1

    Is this Possible

    I am trying to develop a database for recording points allocated to
    participants in a sports championship. Is it possble for the final
    field in a record to generate its value as a sum of other fields in
    the record?

    e.g

    Field Value
    Id 1
    Rider Joe Bloggs
    Number 555
    Class 250
    Meeting 1 10
    Meeting 2 7
    Meeting 3 6
    Meeting 4 0
    Meeting 5 1
    Total This field to be sum of meeting 1-5 above.

    Or is the better method to calculate the value when repeating the data
    back on a page?

    Thanks

    Nick Truscott
  • Siemel Naran

    #2
    Re: Is this Possible

    "Nick Truscott" <njtruscott@bti nternet.com> wrote in message
    [color=blue]
    > Field Value
    > Id 1
    > Rider Joe Bloggs
    > Number 555
    > Class 250
    > Meeting 1 10
    > Meeting 2 7
    > Meeting 3 6
    > Meeting 4 0
    > Meeting 5 1
    > Total This field to be sum of meeting 1-5 above.[/color]

    I don't think this is possible in MySql up to 4.1 because the system does
    not support calculated columns (where the value of one column depends on
    others), or triggers (so that when you update one column the system
    automatically updates another). There is an alpha 5.0
    [color=blue]
    > Or is the better method to calculate the value when repeating the data
    > back on a page?[/color]

    Depends on usage. It might be better to calculate the value when you need
    it to prevent constant updates.


    Comment

    Working...