帮小弟写一条SQL语句!
insert into ServerState(HostId,StateRoad,state) values ((selcet HostId from hostlist where hostMac='00-1E-C9-53-B7-B0'),'n_i',OK)
我插入ServerState表格,现在第一个字段需要从hostlist表中获取。
ServerState表:
HostId StateRoad state
1 n_i ok
hostlist表:
HostId hostMac
1 00-1E-C9-53-B7-B0
2个表如上所示,该怎么插入呢