Aug-31-2018, 05:21 PM
It's been a while since I've done much of any SQL, I want to extract county code from county table and add it to results of places query where the CountyNames match. Here's my attempt which doesn't work:
SELECT (StateCd, CountyName, PlaceCd, StateAbbr, PlaceName, PlaceType, Fstat) FROM places (CountyCd, CountyName) from county where county.CountyName = places.CountyName order by StateCd, CountyCd, PlaceCd;I think it's close to this:
SELECT StateCd, CountyName, PlaceCd, StateAbbr, PlaceName, PlaceType, Fstat FROM places INNER JOIN county ON places.StateCd = county.StateCd AND places.CountyName = county.CountyName order by StateCd, CountyCd, PlaceCd;but I get syntax error on = don't know which one