Neven Draskovic

Neven Draskovic

  • NA
  • 117
  • 139.8k

Complex SQL query help

May 28 2012 4:40 AM
Hey

I have a somewhat complex problem that I need help with. I'm making an application that generates a report containing times of departure from a certain bus station. These departures are all binded to bus lines, and this is where I get the problem. Since these stations might be somewhere in the middle of the line, I need to display the starting and the final station that this bus is going from/to. The problem is that the names and ID's of the stations are all in the same table in the database, and I use that table to identify the station for which I'm generating the report. I'm trying to solve this by using the same table multiple times (in the FROM section I have Stations AS S1, Stations AS S2), but no luck so far. I know that the explanation is a bit complicated, but so is the problem, so please help, an if you need some more informations, I will try to give them to you.

Thanks

Answers (2)