tim freese
asked on
SQL Help
good day.
i have the following table:
ID, PK, integer
activityDescription, varchar
activityDate, datetime
activityState, tinyint
activityType, tinyint
sample data:
8, 'door', '11/16/2018 09:00', 1, 0
8, 'door', '11/16/2018 09:02', 0, 1
6, 'door', '11/16/2018 07:57', 0, 0
6, 'door', '11/16/2018 09:01', 1, 1
5, 'door, '11/16/2018 07:58', 1, 0
5, 'door, '11/16/2018 08:03', 1, 1
5, 'door', '11/16/2018 08:05', 1, 0
i want to display results that MAX(activityDate) where type 1 is > MAX(activityDate) where type 0. therefore, using the data above the result-set would have IDs 8 & 6 but not ID 5.
will you please help me with the query - thanks!
i have the following table:
ID, PK, integer
activityDescription, varchar
activityDate, datetime
activityState, tinyint
activityType, tinyint
sample data:
8, 'door', '11/16/2018 09:00', 1, 0
8, 'door', '11/16/2018 09:02', 0, 1
6, 'door', '11/16/2018 07:57', 0, 0
6, 'door', '11/16/2018 09:01', 1, 1
5, 'door, '11/16/2018 07:58', 1, 0
5, 'door, '11/16/2018 08:03', 1, 1
5, 'door', '11/16/2018 08:05', 1, 0
i want to display results that MAX(activityDate) where type 1 is > MAX(activityDate) where type 0. therefore, using the data above the result-set would have IDs 8 & 6 but not ID 5.
will you please help me with the query - thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER