#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    3
    Rep Power
    0

    How to make sum of columns


    Hello

    I'm using an Oracle Database which looks like this example

    Example (Customer is stored with the amount of different T-Shirts)

    Customer Tshirt(Blue) Tshirt(Black) Tshirt(white)
    Peter 1 5 3
    John 0 2 6
    Silvia 5 0 2

    Now i want to add a column which is called total to count the total amount of t-shirts per customer.

    Does anybody can help me with this problem?

    Thank you in advanced!!!
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,730
    Rep Power
    1959
    why not move/ask the question to the "oracle database" thread
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,788
    Rep Power
    349
    select customer, t_shirt_blue + t_shirt_black + t_shirt_white
    from table

IMN logo majestic logo threadwatch logo seochat tools logo