mysql help

Mariam's Avatar
Go4Expert Member
Suppose I have a table
 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 shabbir; 19Aug2009 at 09:35.. Reason: Code blocks
asha's Avatar, Join Date: Nov 2006
Go4Expert Member
What result do you get from your query?