mysql表连接的时候注意事项

1. null值与null值是不可以连接的

2. 如果希望像null与null进行连接可以有如下方式

select * from ceview LEFT JOIN caview on IFNULL(ceview.ce, -1) = IFNULL(caview.ce,-1) and ceview.ca = caview.ca

3. 在postgresql中使用

select * from ceview LEFT JOIN caview on coalesce(ceview.ce, -1) = coalesce(caview.ce,-1) and ceview.ca = caview.ca

原文地址:https://www.cnblogs.com/angelfan/p/4284720.html