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

posted @ 2015-02-10 18:56  耿小曾  阅读(246)  评论(0编辑  收藏  举报