[jboss-user] [EJB/JBoss] - JBossQL Filtering of most recent action by Time
vandelay
do-not-reply at jboss.com
Thu Nov 8 15:20:38 EST 2007
I am currently having a problem with my query:
SELECT DISTINCT a.userID FROM Availablehistory a
WHERE a.action= 'Sign On' AND a.date BETWEEN ?7 AND ?8
The boundaries reflect the past day time limits ( ?1 = Midnight 4 days ago ?2 = 11:59:59 PM 4 days ago)
This query is incorrect since query should only
be taking in the most recent 'Sign On' action performed by each user,
not all 'Sign On' actions from a user.
So if a user performs action 'Sign On' within the past four days, this query will still return a result back since a user did "Sign On' 4 days ago.
I want to add a condition that will drop users from the results Collection that 'Sign On' in the past 4 days and only add to the result sets users that their most recent 'Sign On' action was 4 days ago.
Any thoughts or help will be appreciated.
Thanks,
Blake
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103082#4103082
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103082
More information about the jboss-user
mailing list