I have a database with three tables:
Tab1
IdTab1
DataTab1
Tab2
IdTab2
DataTab2
Tab3
Id
RifTab (contains 1 or 2)
IdRifTab (contanins the rif id of one of the two tables)
Assuming that IdTab1 and IdTab2 are primary keys, is it possible to create a foreign key for IdRifTab with the two tables depending on value of RifTab?
I know that probably I'm asking for impossible but I'm a self-taught and I learned that asking is the better way for learning.
I want to precise that I looked for a solution to the problem and I found this: One Foreign Key with 2 References Table but my case is different: I need to distinguish the ids of a table from those of the other.
Any suggest is appreciated
Thank you for your time.