• 请不要在回答技术问题时复制粘贴 AI 生成的内容
MonkeyDLuffy
V2EX  ›  程序员

sql 临时表 求指点

  •  
  •   MonkeyDLuffy · Jun 8, 2016 · 2289 views
    This topic created in 3630 days ago, the information mentioned may be changed or developed.

    SELECT bj.billno,bj.lotto_type,bj.site_id,bj.username,bj.trans_id FROM ds_beijing_lotto bj,temp t bj WHERE bj.billno=t.billno UNION SELECT cq.billno,cq.lotto_type,cq.site_id,cq.username,cq.trans_id FROM ds_chongqing_lotto bj ,temp t cq WHERE cq.billno=t.billno

    请问下 后面的 temp 是临时表

    能不能让 temp 只查询一次

    如果查询 2 次会出现 cant reopen temp 异常

    2 replies    2016-06-08 16:46:11 +08:00
    MonkeyDLuffy
        1
    MonkeyDLuffy  
    OP
       Jun 8, 2016
    可以实现吗?
    SmiteChow
        2
    SmiteChow  
       Jun 8, 2016
    一个 query
    select * from table A, table B, table C where A.billno=B.billno and B.billno=C.billno;
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3050 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:40 · PVG 17:40 · LAX 02:40 · JFK 05:40
    ♥ Do have faith in what you're doing.