首页 > 代码库 > postgresql inner join
postgresql inner join
test=> select * from favoriteguidance test-> ; userid | createtime | objectcreatetime | title | objectid -----------+-------------------------------+-------------------------------+-----------+----------- 100000004 | 2017-08-07 00:27:26.452547-04 | 2017-08-07 00:27:26.158434-04 | 校园导航 | 100000013 100000004 | 2017-08-07 00:27:26.606016-04 | 2017-08-07 00:27:26.606016-04 | guidance | 1 100000004 | 2017-08-07 00:27:26.606016-04 | 2017-08-07 00:27:26.606016-04 | guidance | 2 100000071 | 2017-08-09 00:46:08.093299-04 | 2017-08-06 22:53:44.729831-04 | 校园导航1 | 1 3 | 2017-08-09 22:27:13.823857-04 | 2017-08-06 22:53:44.729831-04 | 校园导航1 | 1 1 | 2017-08-10 11:50:52.847896-04 | 2017-08-06 22:53:44.729831-04 | 校园导航1 | 1(6 rows)test=> select favorite.objectID "id" from favoriteGuidance favorite left outer join guidance data on (favorite.objectID = data.id andtest(> favorite.userID = 100000004); id ----------- 100000013 1 2 1 1 1(6 rows)
test=> select favorite.objectID "id" from favoriteGuidance favorite left outer join guidance data on (favorite.objectID = data.id) where favorite.userID = 100000004; id ----------- 100000013 1 2(3 rows)
postgresql inner join
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。