Hey,
I have two tables: In one, I save all seats for a specific room. In the other table, data for the reservations of the seats is stored.
Now, i would like to create a view, where I have a column which marks a seat as marked or unmarked.
Or more abstract: I would like to give out true/false in a table column for a view, if a certain number(the seatnumber) appears in the reservationtable.
Thanks in advance
PS: I use postgres
Table definitions:
View "public.seats"
Column | Type | Modifiers
------------+---------+-----------
ticketname | text |
price | integer |
colour | text |
snr | integer | <- thats thes seatnumber, primary key
px | integer |
py | integer |
rnr | integer | <- the roomnumber, not relevant
Table "public.reservation"
Column | Type | Modifiers
--------+---------+-----------
spnr | integer |
snr | integer | <- references seats
knr | integer |