I have 2 tables - reservation
:
id | some_other_column
----+------------------
1 | value
2 | value
3 | value
And second table - reservation_log
:
id | reservation_id | change_type
----+----------------+-------------
1 | 1 | create
2 | 2 | create
3 | 3 | create
4 | 1 | cancel
5 | 2 | cancel
I need to select only reservations NOT cancelled (it is only ID 3 in this example).
I can easily select cancelled with a simple WHERE change_type = cancel
condition, but I'm struggling with NOT cancelled, since the simple WHERE
doesn't work here.