Results 1 to 5 of 5

Thread: create a table with 3 column where sum of 2 column is 3rd column

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Answers
    22

    create a table with 3 column where sum of 2 column is 3rd column

    create a table with 3 column where sum of 2 column is 3rd column

    ex
    col1 col2 col3
    1 2 3
    3 4 7
    2 2 4


  2. #2
    Junior Member
    Join Date
    Dec 2007
    Answers
    26

    Re: create a table with 3 column where sum of 2 column is 3rd column

    select col1,col2,col1+col2 from table


  3. #3
    Junior Member
    Join Date
    Mar 2009
    Answers
    22

    Re: create a table with 3 column where sum of 2 column is 3rd column

    I need while creating the table, it have to effect the data base table


  4. #4
    Contributing Member
    Join Date
    Jun 2007
    Answers
    65

    Re: create a table with 3 column where sum of 2 column is 3rd column

    I think you can create a trigger on this table which will update the value of third column if there is any insert/update on that table.

    That's the only way I think is to fulfill your requirement.


    ---V V---
    Vikas Vaidya


  5. #5
    Junior Member
    Join Date
    Mar 2009
    Answers
    22

    Re: create a table with 3 column where sum of 2 column is 3rd column

    now i got the answer


    this is the answer


    CREATE TABLE sample6
    (
    col1 int ,
    col2 int,
    col3 as(col1 + col2)
    )


  6.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact