I have got a table for "internet access" with user ID, it has 3 columns user ID, starttime and endtime, i want to make another column which will show how many mins or hours that user was logged in to the internet and also add the total time if the user logged in more than once. can anyone please help me...

i think simple subtract will do that for you.

i think simple subtract will do that for you.

Hi debasisdas,
i also have the same problem and have a mysql table with two columns 'purchases' and 'sales' and would like to have another column 'balance' which is the result of subtracting purchases from sales. I am newbie to MySQL, would you kindly explain more about the simple subtract?

I highly appreciate your help and anyone out there with good ideas.

what you get when you try the following

select purchase,sales,purchase-sales as balance from table_name


I Suggest you that it will not work through SQL Query only.

You have to create Proceduers or Packages to Update users previous logging time.