Haha, you’re absolutely right. It’s about 250-300 KM from the ocean.
Another thing to consider is the long historical record of Yangtze flooding and the depositing of silt and debris in the delta. Until good flood control structures were built, Shanghai is not really in a good place to grow.