944,161 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Unsolved
  • Views: 4941
  • Oracle RSS
Mar 11th, 2009
0

subtract 2 column value

Expand Post »
hi
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...
thanks
kaz
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kazitula is offline Offline
5 posts
since Mar 2009
Mar 12th, 2009
0

Re: subtract 2 column value

i think simple subtract will do that for you.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Oct 5th, 2009
0

Re: subtract 2 column value

Click to Expand / Collapse  Quote originally posted by debasisdas ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Juniour is offline Offline
2 posts
since Oct 2009
Oct 6th, 2009
0
Re: subtract 2 column value
what you get when you try the following

Oracle Syntax (Toggle Plain Text)
  1. SELECT purchase,sales,purchase-sales AS balance FROM table_name
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Oct 13th, 2009
0
Re: subtract 2 column value
Hi

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Drlionheart is offline Offline
10 posts
since Oct 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Oracle Forum Timeline: Trouble with querying in Oracle using SQL
Next Thread in Oracle Forum Timeline: trigger help pls....!!!!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC