View: dbo.Full_Tax_Code_M3_View
View definition
`CREATE VIEW dbo.Full_Tax_Code_M3_View AS SELECT tax_code.client_KEY , CASE WHEN (tax_code.tax_subcode = N'') THEN tax_code.tax_code ELSE (tax_code.tax_code + N'-' + tax_code.tax_subcode) END as description , dbo.sf_Generate_Sortable_Id(CASE WHEN (tax_code.tax_subcode = N'') THEN tax_code.tax_code ELSE (tax_code.tax_code + N'-' + tax_code.tax_subcode) END) AS description_sortable , tax_code.tax_code_KEY FROM dbo.Tax_Code AS tax_code INNER JOIN dbo.Tax_Code_N_Ultra_Tax_Tax_Code AS n_table ON tax_code.tax_code_KEY = n_table.tax_code_KEY INNER JOIN dbo.Ultra_Tax_Tax_Code AS ultra_tax_tax_code ON n_table.ultra_tax_tax_code_KEY = ultra_tax_tax_code.ultra_tax_tax_code_KEY WHERE ultra_tax_tax_code.ultra_tax_category_type_KEY IN (2 /* M3A */, 5 /* All */) GROUP BY tax_code.tax_code_KEY,tax_code.client_KEY,tax_code.tax_subcode,tax_code.tax_code`