Hi i am trying to fetch the data in three tables by using their version colums.
HERE IS MY CODE:
INSERT INTO [dbo].tblCALPLA(ACCOUNT,DATASRC,VERSION)
SELECT ACCOUNT,DATASRC,VERSION FROM [dbo].TBLFACT
WHERE VERSION=(SELECT ID FROM [dbo].VERSION)
UNION
SELECT ACCOUNT,DATASRC,VERSION FROM [dbo].TBLFACT1
WHERE VERSION=(SELECT ID FROM [dbo].VERSION)
UNION
SELECT ACCOUNT,DATASRC,VERSION FROM [dbo].TBLFACT2
WHERE VERSION=(SELECT ID FROM [dbo].VERSION)