August 18, 2022 at 12:28 pm
DDL, Sample Data and expected results will help us help you
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
August 18, 2022 at 8:15 pm
Also, don't cross post. You now have four separate threads with the same question.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 18, 2022 at 8:56 pm
And probably homework.
Here you go, this is an answer for your homework lol:
select t1.station_name, count(distinct t2.station_name) reachable_stations
from train_st t1
left join train_st t2
on t2.code = t1.code
and t2.stop_number > t1.stop_number
and datediff(mi, t1.departure, t2.arrival) <= 60
group by t1.station_name
order by 2 desc, 1;
August 18, 2022 at 10:44 pm
Thank you so much
August 18, 2022 at 11:16 pm
Now has got the answer he wanted he's deleted the evidence. 🤣
August 19, 2022 at 11:05 am
Do you think it's not a good thing? and how do you think like it's a HW work(it's not a HW but I would say type of that). anyhow thank you so much.
August 19, 2022 at 5:17 pm
Now has got the answer he wanted he's deleted the evidence. 🤣
Now you know why I frequently quote the original post. He also deleted the post on his other threads. At least he's complete about being a jerk. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply