2021年1月27日星期三

sql call 2 times the same key_name in the same request key by 2 different ways

the db has 2 tables names trip and user. 1

trip

id | description | user_id |

(user_id references user(id)) (this foreign key means the creator of the trip)

user

id | username

the user could be a participant too, so there is an association table with user_id (references user(id) as participant) and trip_id (references to trip(id), this is the trip which is participating the user participant. [a user can participate to many trips and a trip can have many particpants]. so i want to get in a request postgresql the trip with the user created the trip and all the user who are participating to this trip. i don't find th way to obtain all the participants. any solution is welcome, thanks !

https://stackoverflow.com/questions/65892320/sql-call-2-times-the-same-key-name-in-the-same-request-key-by-2-different-ways January 26, 2021 at 04:57AM

没有评论:

发表评论