猿问

sql用一条select语句对两张结构相同数据不同的表查询

select name from teacher where id = ?

select name from student where id = ?

怎么用一条sql语句写???

不准传表名!!

qq_MEGALOVANIA_0
浏览 3180回答 2
2回答

cxxyjsj

select name from teacher where id = ?union allselect name from student where id = ?
随时随地看视频慕课网APP
我要回答