** mysql同时查两张表,怎么优先返回第一张表数据?**(描述:有3个系统,优先取系统3,系统3不存在对应数据则取系统2,系统2不存在数据取系统1)
[表字段一样,就是查了两次同一张表的不同类型]
create table tbl_org_info
(
ID bigint auto_increment comment 'ID.'
ORG_CODE varchar(50) default '' not null comment '机构编码',
ORG_NAME varchar(50) default '' not null comment '机构名称',
SOURCE_TYPE smallint(4) default 1 not null comment '数据来源,1:系统一,2:系统2,3:系统3'
)