C
Cao Yi
Hi,
Assume that there is a table 't_test' which contains two fields named
'column_user_id' and 'column_login_time', and the related Java code
use String and java.sql.Date to map the two fields.
I just want to get the number of someone's login times during last 24
hour, but I'm not sure the canonical SQL statement, just wrote a
pseudo-code followed, please modify it for a right one! Many thanks in
advance!
select count(column_login_time)
from t_test
where column_user_id = 'someone' AND column_login_time < current_time
- 24
Obviously, " column_login_time < current_time - 24" need to correct,
can you help me?
Assume that there is a table 't_test' which contains two fields named
'column_user_id' and 'column_login_time', and the related Java code
use String and java.sql.Date to map the two fields.
I just want to get the number of someone's login times during last 24
hour, but I'm not sure the canonical SQL statement, just wrote a
pseudo-code followed, please modify it for a right one! Many thanks in
advance!
select count(column_login_time)
from t_test
where column_user_id = 'someone' AND column_login_time < current_time
- 24
Obviously, " column_login_time < current_time - 24" need to correct,
can you help me?