Hi I have a table like so:
SN | User | is_borrowed | date
105 | 1 | 1 |2019-1-1
105 | 1 | 0 |2019-2-1
105 | 1 | 1 |2019-3-1
106 | 2 | 1 |2019-4-1
107 | 1 | 1 |2019-5-1
106 | 2 | 0 |2019-6-1
106 | 2 | 1 |2019-8-1
107 | 1 | 0 |2019-9-1
107 | 2 | 1 |2019-10-1
Wanted output is to show what is borrowed (not returned) and user=1:
SN | User | is_borrowed | date
105 | 1 | 1 |2019-3-1
Output for User=2 and borrowed (not returned):
SN | User | is_borrowed | date
106 | 2 | 1 |2019-8-1
107 | 2 | 1 |2019-10-1
In summary I want a list of devices currently borrowed that are not returned for each user. Sadly nothing comes to my mind tho :/