I am trying to create a query to list only one arrest record per booking.There are two tables JMMAIN (Booking) and ARMAIN (Arrest). The ranking are in the following priority order: F,W,M. If both records are the same, such as BookNum 2 that has two Fs and one M, I want it to display ArrestID 5. In the end I only want one Arrest record for each booking. For example, the table looks like:
JMAIN.BookNum ARMAIN.F/M/W ARMAIN.ArrestID
1 W 3
1 F 4
2 F 5
2 F 6
2 M 7
3 M 8
4 W 9
4 M 10
I want the query to filter the data and only display:
JMAIN.Book ARMAIN.F/M/W ARMAIN.ArrestID
1 F 4
2 F 5
3 M 8
4 W 9
JMAIN.BookNum ARMAIN.F/M/W ARMAIN.ArrestID
1 W 3
1 F 4
2 F 5
2 F 6
2 M 7
3 M 8
4 W 9
4 M 10
I want the query to filter the data and only display:
JMAIN.Book ARMAIN.F/M/W ARMAIN.ArrestID
1 F 4
2 F 5
3 M 8
4 W 9