MySQL Forums
Forum List  »  Newbie

Query need to subtract the date in seconds.
Posted by: Joaquin Henriquez Alzola
Date: October 02, 2015 06:19PM

Hi Guys

I am taking two values from two different tables:
mysql> select sum(t.value) from (select value from radcheck where username='test1' and attribute='dayA_to_dayB' union all select value from raduser_connection_time where username='test1') t;
+--------------+
| sum(t.value) |
+--------------+
| 17888 |
+--------------+
1 row in set (0.00 sec)

mysql>

And I need to subtract in the same query the TIME_TO_SEC(NOW()) from those 17888 (t.value).

Any guidance?

Thanks

PD: I am newbi to this.

Options: ReplyQuote


Subject
Written By
Posted
Query need to subtract the date in seconds.
October 02, 2015 06:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.