All pastes #469230 Raw Edit

Mine

public sql v1 · immutable
·published 2007-05-03 16:57 UTC
rendered paste body
create view SPTasselect country,state =casewhen rtrim(isnull(state,'')) <> '' then statewhen rtrim(isnull(province, '')) <> '' then provincewhen rtrim(isnull(territory, '')) <> '' then territoryelse nullendfrom propertiesgocreate view Statesasselect Country, State from SPTwhere not state is nullgroup by Country, Statego