Foreign key refering to multiple tables
问题 I have 4 tables A(ida, name) B(ida, B-specific stuff) C(ida, C-specific stuff) D(ida, D-specific stuff) and i want that another table E could refer to just B OR C (not D). What can i write in the CREATE TABLE E ? 回答1: Seems to me that you are trying to use some kind of supertype/subtype -- as opposed to simple vertical partitioning. If so, do introduce a type-discriminator. Because this is generic example (A, B, C, D ..) it is hard to guess what relates to what, so here are two options as my