Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- markets_staging=> select u.id,login,email,now()-u.created_at as created_ago,now()-u.updated_at as updated_ago,now()-w.created_at as withdrawn_ago
- markets_staging-> from users u
- markets_staging-> left join withdrawals w on (w.user_id=u.id)
- markets_staging-> where email like 'sisac+%' and login != 'Testingasd'
- markets_staging-> order by login;
- id | login | email | created_ago | updated_ago | withdrawn_ago
- ----+--------------+-------------------------------+-------------------------+-------------------------+-------------------------
- 57 | afalcas17 | sisac+s28@marketstheworld.com | 21 days 00:06:29.970231 | 7 days 01:48:46.409259 |
- 29 | falexandru1 | sisac+s10@marketstheworld.com | 7 days 01:48:46.524555 | 00:09:35.960359 |
- 42 | falexandru10 | sisac+s19@marketstheworld.com | 28 days 01:48:46.467588 | 28 days 01:48:46.383663 |
- 43 | falexandru11 | sisac+s20@marketstheworld.com | 28 days 01:48:46.467588 | 28 days 01:48:46.383663 |
- 46 | falexandru12 | sisac+s21@marketstheworld.com | 21 days 00:06:29.970231 | 00:09:35.960359 |
- 47 | falexandru13 | sisac+s22@marketstheworld.com | 21 days 00:06:29.970231 | 01:48:46.423712 |
- 49 | falexandru14 | sisac+s23@marketstheworld.com | 7 days 01:48:46.524555 | 7 days 01:48:46.409259 |
- 55 | falexandru15 | sisac+s26@marketstheworld.com | 14 days 01:48:46.493763 | 00:09:35.960359 |
- 56 | falexandru16 | sisac+s27@marketstheworld.com | 14 days 01:48:46.493763 | 00:09:35.960359 |
- 30 | falexandru2 | sisac+s11@marketstheworld.com | 14 days 01:48:46.493763 | 00:09:35.960359 |
- 31 | falexandru3 | sisac+s12@marketstheworld.com | 7 days 01:48:46.524555 | 00:09:35.960359 |
- 33 | falexandru4 | sisac+s13@marketstheworld.com | 14 days 01:48:46.493763 | 00:09:35.960359 |
- 35 | falexandru5 | sisac+s14@marketstheworld.com | 7 days 01:48:46.524555 | 7 days 01:48:46.409259 |
- 37 | falexandru6 | sisac+s15@marketstheworld.com | 14 days 01:48:46.493763 | 14 days 01:48:46.399111 |
- 38 | falexandru7 | sisac+s16@marketstheworld.com | 14 days 01:48:46.493763 | 14 days 01:48:46.399111 |
- 40 | falexandru8 | sisac+s17@marketstheworld.com | 21 days 00:06:29.970231 | 21 days 01:48:46.392041 |
- 41 | falexandru9 | sisac+s18@marketstheworld.com | 21 days 00:06:29.970231 | 21 days 01:48:46.392041 |
- 44 | Sorin12 | sisac+12@marketstheworld.com | 35 days 01:48:46.458215 | 35 days 01:48:46.377606 |
- 39 | Sorin13 | sisac+13@marketstheworld.com | 35 days 01:48:46.458215 | 35 days 01:48:46.377606 |
- 36 | Sorin14 | sisac+14@marketstheworld.com | 7 days 01:48:46.524555 | 7 days 01:48:46.409259 | 7 days 01:43:06.404608
- 36 | Sorin14 | sisac+14@marketstheworld.com | 7 days 01:48:46.524555 | 7 days 01:48:46.409259 | 7 days 01:43:06.404608
- 34 | Sorin15 | sisac+15@marketstheworld.com | 7 days 01:48:46.524555 | 7 days 01:48:46.409259 | 7 days 01:43:06.404608
- 34 | Sorin15 | sisac+15@marketstheworld.com | 7 days 01:48:46.524555 | 7 days 01:48:46.409259 | 7 days 01:43:06.404608
- 48 | Sorin17 | sisac+17@marketstheworld.com | 14 days 01:48:46.493763 | 14 days 01:48:46.399111 | 14 days 01:43:06.381339
- 50 | Sorinunuopt | sisac+18@marketstheworld.com | 42 days 01:48:46.448185 | 42 days 01:48:46.371391 | 42 days 01:43:06.365216
- 58 | Testdoizei | sisac+16@marketstheworld.com | 7 days 01:48:46.524555 | 7 days 01:48:46.409259 | 7 days 01:43:06.404608
- 61 | Testpaz | sisac+166@marketstheworld.com | 56 days 00:10:14.246544 | 56 days 00:04:48.144381 |
- (27 rows)
- >> (1..6).each { |i| puts "#{i} weeks is #{i.weeks.to_i} s" }
- 1 weeks is 604800 s
- 2 weeks is 1209600 s
- 3 weeks is 1814400 s
- 4 weeks is 2419200 s
- 5 weeks is 3024000 s
- 6 weeks is 3628800 s
- markets_staging=> select e.id,u.id,login,email,demo,active,withdrawn,timescale,sent
- from email_reminders e
- join users u on (e.user_id=u.id)
- order by login;
- id | id | login | email | demo | active | withdrawn | timescale | sent
- --------+----+--------------+-------------------------------+------+--------+-----------+-----------+----------------------------
- 257134 | 57 | afalcas17 | sisac+s28@marketstheworld.com | t | t | | 604800 | 2016-05-13 12:53:18.835433
- 257135 | 57 | afalcas17 | sisac+s28@marketstheworld.com | t | t | | 1209600 | 2016-05-13 12:53:18.859347
- 257137 | 42 | falexandru10 | sisac+s19@marketstheworld.com | f | f | | 1209600 | 2016-05-13 12:57:28.784624
- 257138 | 42 | falexandru10 | sisac+s19@marketstheworld.com | f | f | | 1814400 | 2016-05-13 12:57:28.807957
- 257142 | 46 | falexandru12 | sisac+s21@marketstheworld.com | t | t | | 604800 | 2016-05-13 13:01:59.870667
- 257143 | 46 | falexandru12 | sisac+s21@marketstheworld.com | t | t | | 1209600 | 2016-05-13 13:01:59.8875
- 257145 | 47 | falexandru13 | sisac+s22@marketstheworld.com | f | t | | 1209600 | 2016-05-13 13:01:59.915909
- 257144 | 47 | falexandru13 | sisac+s22@marketstheworld.com | f | t | | 604800 | 2016-05-13 13:01:59.900272
- 257132 | 30 | falexandru2 | sisac+s11@marketstheworld.com | t | t | | 604800 | 2016-05-13 12:43:55.107906
- 257133 | 33 | falexandru4 | sisac+s13@marketstheworld.com | f | t | | 604800 | 2016-05-13 12:50:14.754715
- 257136 | 40 | falexandru8 | sisac+s17@marketstheworld.com | f | f | | 1209600 | 2016-05-13 12:55:16.237444
- 257141 | 44 | Sorin12 | sisac+12@marketstheworld.com | f | f | | 2419200 | 2016-05-13 12:59:04.114802
- 257139 | 44 | Sorin12 | sisac+12@marketstheworld.com | f | f | | 1209600 | 2016-05-13 12:59:04.089908
- 257140 | 44 | Sorin12 | sisac+12@marketstheworld.com | f | f | | 1814400 | 2016-05-13 12:59:04.104605
- 257159 | 48 | Sorin17 | sisac+17@marketstheworld.com | f | f | t | 604800 | 2016-05-13 13:39:44.840997
- 257155 | 50 | Sorinunuopt | sisac+18@marketstheworld.com | f | f | t | 1209600 | 2016-05-13 13:39:44.761993
- 257156 | 50 | Sorinunuopt | sisac+18@marketstheworld.com | f | f | t | 1814400 | 2016-05-13 13:39:44.779714
- 257157 | 50 | Sorinunuopt | sisac+18@marketstheworld.com | f | f | t | 2419200 | 2016-05-13 13:39:44.791936
- 257158 | 50 | Sorinunuopt | sisac+18@marketstheworld.com | f | f | t | 3024000 | 2016-05-13 13:39:44.8055
- (19 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement