Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 MySql 查询,它在 1 个数据库上运行良好,但在另一个数据库上失败,因为第二个数据库在 select 子句中没有 1 个字段。有没有办法让 1 个查询在第一个数据库中返回正确的值,但在第二个查询中只返回 NULL 或空,例如
SELECT DISTINCT tbl.a, tbl.b, tbl.c FROM DB as tbl
即想象tbl.c存在于数据库 1 但不存在于数据库 2
tbl.c