Solved

Union Joins

Posted on 2012-04-04
11
222 Views
Last Modified: 2012-04-17
I have three unions [1011], [1011], [1112].

With the unions you need to have the same numhber of rows in each select, which is fine.

The additional select in each union is      
,[Primary Diagnosis Code],LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC

But my question is I only want to do the joins on the last union. But this causes a problem because Msg 4104, Level 16, State 1, Line 119
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
Msg 4104, Level 16, State 1, Line 279
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.

Which means the join need to be in each union.



SELECT

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]


           
FROM  [0910]


      UNION ALL

     
SELECT  

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]

     
FROM [1011]

      UNION ALL

SELECT

      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]
 
 
     
FROM      [1112]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


GO
0
Comment
Question by:aneilg
  • 5
  • 5
11 Comments
 
LVL 6

Expert Comment

by:ingriT
ID: 37805012
Try using the UNION keyword instead of the UNION ALL keyword.
0
 
LVL 15

Accepted Solution

by:
gplana earned 325 total points
ID: 37805035
ingriT: UNION eliminates duplicates and UNION ALL don't. So I don't think the solution is to change UNION ALL by UNIONs.

aneilg: All SELECTs should have the same number of columns, and the same datatype on every column, but every select can have a different number of rows, no problem on this.

I'm not understanding the problem: it looks like ICD_PRIM_DIAG.ICD104NM field is on one of the join tables, so if you want this field on a select you need to join to this table. If you don't want this column on a select, just replace it by a value that matches the datatype of this field. For example, if this field is a text based field, you can do something like this:

SELECT

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]


           
FROM  [0910]


      UNION ALL

     
SELECT  

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,'' AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]

     
FROM [1011]

      UNION ALL

SELECT

      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,'' AS PRIMARY_DIAGNOSIS_DESC
     
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]
 
 
     
FROM      [1112]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


GO

Open in new window


Hope it helps
0
 

Author Comment

by:aneilg
ID: 37805264
this is an example of the select working.

my question is, is it possible not to have the joins in each union, only having the join on [1112]. but the problem is

Msg 4104, Level 16, State 1, Line 119
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
ect.

the query as it stands need the joins in each union. is it possible to only have the join on
the last query

SELECT

      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

            
FROM  [0910]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]

      UNION

      
SELECT  

     
      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

      
      
FROM [1011]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


      UNION

SELECT



      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC

      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

      
FROM      [1112]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]
0
 
LVL 15

Expert Comment

by:gplana
ID: 37805484
Yes, just try to remove joins now, as I have replaced the field by an empty string on the select.
0
 

Author Comment

by:aneilg
ID: 37805497
ok i'll give it a go.

i was told this approcah is possible.
Select fieldNames from (

10/11 query

Union all

11/12 query

) as subQuery
Then do all the joins here
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 15

Expert Comment

by:gplana
ID: 37805561
Yes, this is also possible, but isn't it better the solution I give ?

Or maybe I misunderstood the goal ?
0
 

Author Comment

by:aneilg
ID: 37805578
yeah but he is Adamant I do it his way.


but if i do

SELECT * FROM (

SELECT

      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

           
FROM  [0910]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]

      UNION

     
SELECT  

     
      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

     
     
FROM [1011]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


      UNION

SELECT



      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC

      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

     
FROM      [1112]

) as g


                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


i get Msg 4104, Level 16, State 1, Line 121
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
0
 
LVL 15

Expert Comment

by:gplana
ID: 37805600
Ok, in this case try the other approach:

SELECT .... FROM (
                 SELECT ... (without joins)
                 UNION ALL
                 SELECT ... (without joins)
                 UNION ALL
                 SELECT ... (without joins)
) and make the joins here
0
 

Author Comment

by:aneilg
ID: 37805652
thanks for your help,

i've done

SELECT * FROM (

) as g

joins

but get Msg 4104, Level 16, State 1, Line 121
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
Msg 4104, Level 16, State 1, Line 125

is this appracah possible.
0
 
LVL 15

Expert Comment

by:gplana
ID: 37805834
This is because you don't have the ICD_PRIM_DIAG table on your SELECT or because field ICD104NM is not a valid field on ICD_PRIM_DIAG table
0
 

Author Closing Comment

by:aneilg
ID: 37855755
thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now