I can’t find the official list, but a good fraction (my swag is roughly a third) of the Navy’s enlisted ratings (and a similar portion of officers) either don’t go to sea on ships or do so only rarely. And that last part kind of muddies the waters, because “rarely” might make it relatively easy to do a standard four to eight year enlistment without going to sea, but somewhat harder to get all the way to retirement eligibility (20+ years) without going even once.
Examples include:
-A good portion of naval aviators, flight officers, enlisted aircrew, and maintenance personnel who work on the Navy’s land-based aircraft (like the P-3, P-8, and E-6). The officers who fly/operate those planes will eventually be required to serve on a ship for maybe two years out of every ten.
-Explosive Ordinance Disposal. They used to put EOD officers and enlisted techs on minesweepers, but since the late unpleasantness in the Middle East kicked off and they started needing EOD in places like Iraq and Afghanistan, they don’t do that anymore.
-SEALs. If they’re on a ship at all, it’s not for very long (think a Captain Phillips sort of situation, where they show up to deal with a specific crisis, do their thing, and then get out).
-Various supply and logistics types could specialize in supporting expeditionary warfare units (like SEALs, Seabees, Riverine, and so on) or land-based aviation supply.
-Cryptographers and linguists. Some might be assigned to ships, but depending on their specific specialty, they might spend the bulk of their career ashore. Ditto with certain intel types.
That’s by no means an exhaustive list, and even within some seagoing ratings, there may be some who manage to weave their way through the system and slip through the cracks by doing, say, a land-based deployment to the Middle East in lieu of a more traditional assignment to a ship (and yes, I personally would rather go boots on ground to Iraq or Afghanistan than serve on a ship again). There are also those who do spend a good portion of their career on ships, but somehow manage to avoid ever going out to sea on those ships (in the surface nuclear engineering community, this is possible by always getting assigned to the CVN that is undergoing its refueling, which requires several years to complete).