Select * Into MC1_CityZipCodeExt_LAB_NOVO -- new table to receive the results FROM SELECT y.lIdState as lIdState, -- lIdState LOC_NU, -- cIdCity LOC_NO, -- cNameCity UFE_SG, -- cCodeState CEP, -- cZiCode 1 as mc1Enabled, -- mc1Enabled CURRENT_TIMESTAMP as mc1LastUpdate, --mc1LastUpdate 'novo' as condicao FROM LOG_LOCALIDADE_OK t LEFT JOIN MC1_StateZipCodeExt y ON t.UFE_SG = y.cState WHERE NOT EXISTS (SELECT NULL FROM MC1_CityZipCodeExt x WHERE x.cIdCity = t.LOC_NU AND x.cCodeState = t.UFE_SG AND x.cZiCode = t.CEP ) AND t.CEP IS NOT NULLand
SELECT y.lIdState as lIdState, -- lIdState LOC_NU, -- cIdCity LOC_NO, -- cNameCity UFE_SG, -- cCodeState CEP, -- cZiCode 1 as mc1Enabled, -- mc1Enabled CURRENT_TIMESTAMP as mc1LastUpdate, --mc1LastUpdate 'novo' as condicao FROM LOG_LOCALIDADE_OK t LEFT JOIN MC1_StateZipCodeExt y ON t.UFE_SG = y.cState WHERE NOT EXISTS (SELECT NULL FROM MC1_CityZipCodeExt x WHERE x.cIdCity = t.LOC_NU AND x.cCodeState = t.UFE_SG AND x.cZiCode = t.CEP ) AND t.CEP IS NOT NULL Into MC1_CityZipCodeExt_LAB_NOVO
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
This award recognizes an author who contributes the highest volume of original works or content. Recipients of this award produce extremely valuable content that prioritizes accuracy, relevancy, and professionalism.