学生表里面有省份简写,分表是省份表,t_cccoinol+省份简写。分表里面学生ID和学生表关联,和其他字段,本人怎么吧分表里面的数据查出来
解决方案
30
select *
from 学生表 , (
select “tj” as s ,* from t_cccoinoltj union all
select “sh” as s ,* from t_cccoinolsh union all
…
select “zj” as s ,* from t_cccoinolzj union all
) b
on 学生表.shotprovc = b.s
from 学生表 , (
select “tj” as s ,* from t_cccoinoltj union all
select “sh” as s ,* from t_cccoinolsh union all
…
select “zj” as s ,* from t_cccoinolzj union all
) b
on 学生表.shotprovc = b.s
10
create view v_t_cccoinol as
select * from table1
unioin all
select * from tale 2
;
然后查询直接引用这个视图就好了啊
select * from table1
unioin all
select * from tale 2
;
然后查询直接引用这个视图就好了啊