How to link data from two tables
This is probably a very simple thing but I'm not sure how to.
I have a table which has a field with an id 'a', how can I look up the value of 'a' in table 'b' and have that returned in the response?
I am using findMany, will I have to use .join?
3 Replies
Please let us see the schema that you're working with and what is the shape of the response that you need.
Thanks, I have two tables
And
I would like twoTab to have the value of one and two filled with the values from oneTab but under a category key
I'm sorry, can you elaborate? maybe a code example could make it easier to understand. The shape of the object you'd like to obtain
I feel like if you have the relations defined between those two table, findMany is a great way