zoukankan      html  css  js  c++  java
  • left join测试验证之一

    $ sqlite3 a.db
    SQLite version 3.8.1 2013-10-17 12:57:35
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> create table a (uname char(10),uid int);
    sqlite> create table b (uid int, udepart int);
    sqlite> create table c (uid int, ustate int);
    sqlite> insert into a values('U1',1);
    sqlite> insert into a values('U2',2);
    sqlite> insert into a values('U3',3);
    sqlite> insert into b values (1,1);
    sqlite> insert into b values (2,2);
    sqlite> insert into c values (1,1);
    sqlite> insert into c values (2,2);
    sqlite> select a.uname,a.uid,b.udepart,c.ustate from a left join b on a.uid = b.uid left join c on a.uid=c.uid;
    U1|1|1|1
    U2|2|2|2
    U3|3||
    sqlite> select a.*,b.udepart,c.ustate from a left join b on a.uid = b.uid left join c on a.uid=c.uid;
    U1|1|1|1
    U2|2|2|2
    U3|3||
    sqlite> .header on
    sqlite> select a.*,b.udepart,c.ustate from a left join b on a.uid = b.uid left join c on a.uid=c.uid;
    uname|uid|udepart|ustate
    U1|1|1|1
    U2|2|2|2
    U3|3||
    sqlite> insert into a values('u4',4);
    sqlite> insert into c values(4,4);
    sqlite> select a.*,b.udepart,c.ustate from a left join b on a.uid = b.uid left join c on a.uid=c.uid;
    uname|uid|udepart|ustate
    U1|1|1|1
    U2|2|2|2
    U3|3||
    u4|4||4
    sqlite>

  • 相关阅读:
    python 之 Multiprocessing 多进程
    python 之 Threading 多线程
    Python实战 -- 利用Flask搭建微电影网站(一)蓝图构建
    R语言学习——作图
    python 之 pandas 总结
    python 之 numpy 总结
    C++使用Jsoncpp源码
    C++左值、左值引用、右值、右值引用
    std::forward
    std::move
  • 原文地址:https://www.cnblogs.com/decwang/p/4647503.html
Copyright © 2011-2022 走看看