All vertebrates, including fish, must maintain a certain salt concentration inside their bodies. The salt concentration is independent of the external medium and is 1/4 to 1/2 of the seawater concentration.
Effective regulatory mechanisms effectively control the salt concentration in both freshwater and saltwater fish. Osmoregulation maintains the total salt levels necessary for metabolism. Ion regulation maintains a very specific composition of the ion mix in the cells.
Neither in freshwater fish nor in saltwater fish does the salinity match that of the environment. In order to maintain their internal environment, freshwater fish absorb Na+ and Cl- through their chloride cells on their gills. Freshwater fish absorb a lot of water through osmosis. As a result, they drink little and pee almost constantly.
In contrast, seawater fish lose water to the environment through osmosis. They have to replace the lost water with drinking. Saltwater fish excrete a lot of salt.