I'm new to Postgres and am trying to find a way that if one value in one table reads true, then to give me a another value in another table.
Here is one table:
itemid | pictureid1 | pictureid2 | smallpic | medpic | largepic
--------+------------+------------+----------+--------+----------
100 | 1 | 2 | t | t | t
101 | 3 | 4 | t | t | t
102 | 5 | 6 | t | t | t
103 | 7 | 8 | t | t | t
104 | 9 | 10 | t | t | t
105 | 11 | 12 | t | t | t
106 | 13 | 14 | t | t | t
107 | 15 | 16 | t | t | t
108 | 17 | 18 | t | t | t
109 | 19 | 20 | t | t | t
And here is the other:
id | size | size_url
----+--------+-----------------------------------------
1 | small | https://loremflickr.com/54/54?lock=
2 | medium | https://loremflickr.com/400/400?lock=
3 | large | https://loremflickr.com/1000/1000?lock=
I'm trying to get it where if for a particular itemid it says "true" for smallpic, then it gives me the size_url for small in the other table, with the pictureid1 and pictureid2 in the first table.