阅读背景:

MySQL - 如果column为null,则从另一个表中检索值

来源:互联网 

Let's say I have a table setup with a few values, including a name, an ID, and a foreign key that references the ID of another table. The name can be null. When I select all the records from this table, I want to get the name if it is not null. If it is, I want to get the name of the record referenced by the foreign key. I am able to modify the database structure if necessary, or I can simply change the query. What are my options?Let's say I have a table setup with a few value




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: