V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
MonkeyDLuffy
V2EX  ›  程序员

sql 临时表 求指点

  •  
  •   MonkeyDLuffy · Jun 8, 2016 · 2263 views
    This topic created in 3616 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   ·   863 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 18:49 · PVG 02:49 · LAX 11:49 · JFK 14:49
    ♥ Do have faith in what you're doing.