In 1977 the San Francisco Giants finished fourth in their division, 23 games out of first place. Slightly more than 800,000 persons paid to watch them. Last winter, the team came within an angstrom of being moved east, and it was assumed that 1978 would be its final year in San Francisco.

Right now, the Giants are in first place, have led their division much of the year, and attendance - at more than double last year's rate - is projected to top 1.6 million. The moral: the cure for sick attendance is a winning team.

In 1977 the Oakalnd A's finished seventh in their division, 38 1/2 games out. Fewer than 500,000 people showed up for their ordeal. Last winter, the team's scheduled departure to Denver was reversed only by last minute bickering and it was assumed that 1978 would be its final year in Oakland.

Right now, the A's are fighting for the first place, have led their division part of the year, and attendance - at maybe 3,000 above last year - is projected to be again the worst in the majors. The moral: the cure for sick attendance is not necessarily a winning team.

Given two young, contending ball clubs playing in comparably-sized cities just 10 miles apart, averaging crowds of 21,700 and 7,900 respectively, you have to ask - what gives?

It's not on-field performance - both teams play solid baseball, with swashbuckling elan and eminently watchable pitching. Nor even popularity - televised A's games consistently clean up in the ratings. And it's nothing new - the A's have never drawn much more than walk-in traffic, while the Giant's turnout has always reflected their won-lost record.

Admittedly, San Francisco and Oakland are as different in character as Disneyland and Duluth, but far more significant is the difference in the relationaship between each team's ownership and its host city. The history of this difference is, in fact, a textbook case of the right and wrong ways of building fan loyalty and support. To wit:

Right - be located in a city which is as image-conscious as the Royal Family, a city which will panic at the idea of losing its "major league" status, and whose city fathers will make keeping-the-team the greatest civic crusade since conserving water.

Wrong - be located in a low-profile town with only slightly more civic consciousness than a trailer camp. Convince the city fathers that keeping the team is a dreary and unlikely proposition.

Right - have the club co-owned by an established local businessman who makes strong public commitments to the city and fans, and vows to stick it out while noting that greater attendance will determine the outcome.

Wrong - run the club from Indiana, diligently avoiding and occasionally badmouthing the city and fans. Vow to deal the club elsewhere at the first opportunity while noting that greater attendance will have no bearing on an outcome.

Right - focus attention onto the players. Laud and promote them relentlessly, emphasizing the fact that the team not only belongs to the locals, but is an expression of their personality.

Wrong - focus attention onto yourself. Fill the yearbook with your face and biography, promote yourself relentlessly and the team negligibly, and belittle the players while taking credit for all success. Emphasize the fact that the team is yours alone, and an expression of your personality. Have an unpalatable personality.

Right - hang onto popular players, and try to maintain a sense of team tradition and continuity. Bring back a living symbol of the glory days (Willie McCovey) and acquire from your competitor across the bay the area's most popular player (Vida Blue).

Wrong - trade, sell or drive off every popular player you have, just when attendance is building, and unload new players frequently to preclude followings from developing. Trade the last symbol of the glory days for criticizing you (Bill North) and give your competitor across the bay the area's most popular player (Blue).

Indeed, the A's wrongs - antagonizing the local press, broadcasting games over a 10-watt college radio station with student announcers, publicly inviting just-resigned Richard Nixon to throw out theplayoff game ball, ad alienatum - make almost anything the Giants do look right.

That is the crux of Bay area baseball today, as it has been since the A's arrived: not the Giants' sudden and remarkable ability to attract fans, but Charlie Finley's consistent and amazing ability to repel them.