Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了这个 ipview:
这个tcpview:
如您所见,tcpview 较小,因为某些 cid 没有端口,所以我想将这两个视图结合起来,当 cid 没有端口时,在该字段中将其设为空,我应该在这里进行哪些操作以及如何操作?
left join表并用于ifnull将null值更改为空。
left join
ifnull
null
select i.cid, i.ip_src, i.ip_dst, ifnull(t.tcp_sport, '') as tcp_sport, ifnull(t.tcp_dport, '') as tcp_dport from ipview i left join tcpview t on i.cid = t.cid