我需要帮助来连接sybase数据库中的以下两个选择。
SELECT HOST_ENTRY.ID
,HOST.NAME
,HOST_ENTRY.TYPE
,HOST_ENTRY.NAME
,HOST_ENTRY.IP
,HOST_ENTRY.IP_LAST
,HOST_ENTRY.NETADDR
,HOST_ENTRY.MASK
from HOST_ENTRY
INNER JOIN HOST
ON HOST_ENTRY.HOST_ID=HOST.ID;
SELECT HOST_GRP_MEMBER.ID
,HOST_GROUP.NAME
,HOST.NAME
from HOST_GRP_MEMBER
INNER JOIN HOST_GROUP ON HOST_GRP_MEMBER.GROUP_ID=HOST_GROUP.ID
INNER JOIN HOST ON HOST_GRP_MEMBER.HOST_ID=HOST.ID
ORDER BY HOST_GROUP.NAME
答案 0 :(得分:0)
那-
SELECT HOST_ENTRY.ID
,HOST.NAME
,HOST_ENTRY.TYPE
,HOST_ENTRY.NAME
,HOST_ENTRY.IP
,HOST_ENTRY.IP_LAST
,HOST_ENTRY.NETADDR
,HOST_ENTRY.MASK
,HOST_GRP_MEMBER.ID
,HOST_GROUP.NAME
,HOST.NAME
from HOST_ENTRY
INNER JOIN HOST ON HOST_ENTRY.HOST_ID=HOST.ID;
INNER JOIN HOST_GRP_MEMBER ON HOST_GRP_MEMBER.HOST_ID=HOST.ID
INNER JOIN HOST_GROUP ON HOST_GRP_MEMBER.GROUP_ID=HOST_GROUP.ID
ORDER BY HOST_GROUP.NAME