How to generate table or create a view that uses multiple rows of the same table?

Hi Gliders, I’m new to Glide and it would be really helpful if you can give me some ideas how to solve this problem
Context : I’m building prototype of a carpool like app which helps bringing together carpool providers and seekers. The user fills a form about start and end points, start time and no of seats needed/ to be offered.
All this info goes into a common table along with user id and whether they are ride seekers or providers.

Now for matched rides, for every user, I need to display the info about other users who satisfy the matching condition ( common start point/time and no of seats etc). This will involve comparing columns of different rows of the same table, i.e. for all columns, the app should iterate over all other rows and filter out only the matching ones.
Either i have to filter the common table based on some conditions OR I should generate a new data table from the first using some conditions. (kinda like SQL self join)

Can you help me what combinations of glide features can help me here ?

Your biggest challenge may be determining the appropriate matching conditions. Most car pools don’t go from the same exact start point and end points. You need to provide each person flexibility in defining their desired range of start point and end point. For example, is the acceptable start point, x city blocks, x kilometers, x miles, etc apart or same town, same zip code, same county, etc. This maybe trickier than it first seems.

Hi. I understand that the real life matching conditions will be tricky to implement but since it’s just a prototype, let’s assume there are designated points on the same route. Even Now the challenge in implementing the comparison of two rows of the same table is still the same. Can you suggest what feature can be used if the matching conditions are just the basic ones?

You would likely save all persons (riders and drivers) in the same table. You add a Template column to concatenate the StartPoint and EndPoint columns into a single column (Start_End). Then you would add a self Relation column (Rel_Start_End) to relate all the users in the same table that have a matching Start_End. You could also add a Query column using the Rel_Start_End relationship to add the capability to do filtering or sorting to your results.

I don’t have an exact idea about your data structure, but I think a query column, as Fred suggested above, would help here. You would be able to compare the data of all rows in the table with the “current row” data and find matches for each row.