Select to view content in your preferred language

Problem with a joint

305
0
08-01-2022 09:03 AM
Labels (1)
NATHANMARYCAMPION
New Contributor II

Hello,

I need to join two tables but it is a little bit tricky.

I have two tables Schedule and Runs:

Here Schedule:

NATHANMARYCAMPION_0-1659366382606.png

 

And here Runs:

NATHANMARYCAMPION_2-1659366513257.png

 

The table Runs show the start of runs in a public transport network.

The hour when Runs beginning is indicated by the StartRun field. It show the number of minutes after midnight when the run begin.

The ScheduleID is an ID related to the Schedule table.

This one is composed by an ID who put together the differents parts of the schedule, each scheduleID is composed of differents parts of the route named by SQIDX. each SQIDX have the departure and arrival fields who represents the time passed since the beginning of the runs at each stops .

So, I need to join those tables to have real hours (624 minutes = 10:24 for exemple)

But I can't because on table is multiple and the other is not.

I tought to do an iteration for each lines of Runs and make a selection to add the scheduleID according to the line in another table but how can i bring the variable into my SQL selection?

Or maybe in python but my level is too bad for the moment.

Do you have any idea?

 

Tags (2)
0 Kudos
0 Replies