USE AgeDx DROP TABLE #temp SELECT * INTO #temp FROM [dbo].[DxAge_1] -- 4233546 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_2] -- 5223128 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_3] -- 4179754 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_4] -- 3807014 rows SELECT CAST([id] as int) as id [icd9] 2 ‚ IIF([AgeAtDx] = 'NULL', null, CAST([AgeAtDx] as float)) as AgeAtDx IIF(AgeAtFirstDM = 'NULL', null, CAST([AgeAtFirstDM]as float)) as [AgeAtFirstDM] IIF(AgeAtDeath ='NULL',null, CAST([AgeAtDeath]as float)) as [AgeAtDeath] INTO dbo.final FROM #temp

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter13: Views
Section: Chapter Questions
Problem 4HOA: Attempt to view the structure of the HOMEWORK13 view.
icon
Related questions
Question

I keep getting errors for this code in SQL but i cant seem to fix it, assuming the names for the files are correct is there any obvious errors?

9
AVAL
USE AgeDx
DROP TABLE #temp
SELECT * INTO #temp FROM [dbo].[DxAge_1] -- 4233546 rows
INSERT INTO #temp SELECT * FROM [dbo].[DxAge_2] -- 5223128 rows
INSERT INTO #temp SELECT * FROM [dbo].[DxAge_3] -- 4179754 rows
INSERT INTO #temp SELECT * FROM [dbo].[DxAge_4] -- 3807014 rows
SELECT CAST([id] as int) as id
[icd9]
www.vjpe
9
INTO dbo.final
FROM #temp
IIF([AgeAtDx] = 'NULL', null, CAST([AgeAtDx] as float)) as AgeAtDx
IIF(AgeAtFirstDM = 'NULL', null, CAST([AgeAtFirstDM]as float)) as [AgeAtFirstDM]
IIF(AgeAtDeath ='NULL',null, CAST([AgeAtDeath]as float)) as [AgeAtDeath]
Transcribed Image Text:9 AVAL USE AgeDx DROP TABLE #temp SELECT * INTO #temp FROM [dbo].[DxAge_1] -- 4233546 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_2] -- 5223128 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_3] -- 4179754 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_4] -- 3807014 rows SELECT CAST([id] as int) as id [icd9] www.vjpe 9 INTO dbo.final FROM #temp IIF([AgeAtDx] = 'NULL', null, CAST([AgeAtDx] as float)) as AgeAtDx IIF(AgeAtFirstDM = 'NULL', null, CAST([AgeAtFirstDM]as float)) as [AgeAtFirstDM] IIF(AgeAtDeath ='NULL',null, CAST([AgeAtDeath]as float)) as [AgeAtDeath]
Expert Solution
steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Windows
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning