zoukankan      html  css  js  c++  java
  • 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 and
    test(> 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)
  • 相关阅读:
    shell脚本大小写转换
    python写xml及几个问题
    Java集合系列导读
    Java集合系列之Collection接口
    并发编程之锁机制
    Java中的堆内存和栈内存
    Java与ElasticSearch的交互操作
    ElasticSearch基础概念
    Java的对象和类
    Spring Validator参数校验
  • 原文地址:https://www.cnblogs.com/cdyboke/p/7349883.html
Copyright © 2011-2022 走看看