Need help for classification look up table

Database

Need help for classification look up table

Hi,

I looking for a query to compare source A to Classification look up table and then compare the result between Classification & target b table.

Source Table:

sCol 1, sCol2, sCo1 3

s1    test1   102

s2    test2   109

Classification:

cCol1, cCol2, cCol3

1     102     clsval1

2     null     null ----- 109 not available in look up table

3     null     null

Target Table:

tCol1  tCol2     tCol3

1        clsVal1     test1   ---------- for 102

2        #             test2   ------------- for null value in classification, are replaced as # and loaded into target.

Since the source value is getting changed in classification and loaded into the target table, I'm not sure how to verify the source value correctly loaded in the target table & correct classification value is loaded...

appreciate any suggestion... 

2 REPLIES

Re: Need help for classification look up table

Hi,

Do u want to verify for those rows which doesn't have their entry in classification table also??

Re: Need help for classification look up table

If u don want to consider rows that are not present in classification table then u can try

sel b.sCol 1,a.cCol3,a.cCol2,b.sCo1 3,c.tCol3

from classification a

join Source b

on

a.cCol2=b.sCo1 3

join Target c

on

c.tCol2=a.cCol3

where c.tCol3 <> b.sCol2

this will give the rows for which source data is changed and loaded into target.I haven't tried this query.jus an idea.