-- PlaceAbbrevUpdate.sql
/*
2013-02-17 Tom Holden ve3meo
Combines up to the first two parts of the Standardized Place name
(the Normalized column) and places the concatenated result in the
Abbrev column of PlaceTable for Places having non-empty Normalized
fields.

Requires temp xPlacePartsTable generated by PlaceParse.sql or equiv.
*/
UPDATE PlaceTable
SET Abbrev = (
		SELECT CASE 
				WHEN Comma1 > 0
					THEN Place1 || ', ' || Place2
				ELSE Place1
				END AS Abbrev
		FROM xPlacePartsTable
		WHERE PlaceTable.PlaceID = xPlacePartsTable.PlaceID
		)
WHERE PlaceID IN (
		SELECT PlaceID
		FROM xPlacePartsTable
		);
