主表 X : id, key_1, key_2, key_3
表 A : id, x_id(foreign key), a_key_1, a_key_2, a_key_3
表 B : id, x_id(foreign key), b_key_1, b_key_2, b_key_3, c_key_4
表 C : id, x_id(foreign key), c_key_1, c_key_2, c_key_3, c_key_4, c_key_5
如何一条语句,查出如下需要的结果呢?
key_1, key_2, key3, a_key_1, a_key_2, a_key_3
key_1, key_2, key3, b_key_1, b_key_2, b_key_3
key_1, key_2, key3, c_key_1, c_key_2, c_key_3
还有,我这种建表方式是不是有问题?
表 A : id, x_id(foreign key), a_key_1, a_key_2, a_key_3
表 B : id, x_id(foreign key), b_key_1, b_key_2, b_key_3, c_key_4
表 C : id, x_id(foreign key), c_key_1, c_key_2, c_key_3, c_key_4, c_key_5
如何一条语句,查出如下需要的结果呢?
key_1, key_2, key3, a_key_1, a_key_2, a_key_3
key_1, key_2, key3, b_key_1, b_key_2, b_key_3
key_1, key_2, key3, c_key_1, c_key_2, c_key_3
还有,我这种建表方式是不是有问题?