Create table a表(tagindex int,tagvalue int,time char(5))
insert a表 select 1,3,'11:30'
union all select 2,7,'11:30'
union all select 1,4,'11:40'
union all select 2,8,'11:40'
Create table b表(tagname char(2),tagindex int)
insert b表 select 'kk',1
union all select 'ss',2
Create table c表(tagname char(2),tagdescription varchar(10))
insert c表 select 'kk','液位'
union all select 'ss','压力'
Select c.tagdescription,a.tagvalue,a.time
from a表 a
join b表 b on a.tagindex = b.tagindex
join c表 c on b.tagname = c.tagname
Select c.tagdescription,a.tagvalue,a.time
from a表 a
join b表 b on a.tagindex = b.tagindex
join c表 c on b.tagname = c.tagname