mysql help

Discussion in 'MySQL' started by Mariam, Aug 18, 2009.

  1. Mariam

    Mariam New Member

    Joined:
    Sep 9, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Suppose I have a table
    Code:
     ID   userName     fyears  tyears
       1   nika             2007     2009
       2   nika             2005     2009
       3   nika             2000     2005
       4   nika             1999     2000
       5   nika             1996     1998
    
    fyears is when the user nika started to work, tyears-ended
    I need to select the total work experience, now it is =12

    SELECT sum(tyears-fyears) FROM WE
    I did in this way but it works inappropriately
     
    Last edited by a moderator: Aug 19, 2009
  2. asha

    asha New Member

    Joined:
    Nov 9, 2006
    Messages:
    44
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Homemaker
    Location:
    Kolkata
    Home Page:
    http://whatanindianrecipe.com
    What result do you get from your query?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice