多个查询用 UNION 连接,在连接处希望插入空行,采用如下方案:查询1 UNION  查询空行 UNION  查询2问“查询空行” 如何写?

解决方案 »

  1.   

    select column1,column2 from table1 union select '','' union select column1,column2 from table2 不过这样是无序的.
      

  2.   

    用一个假的命题如: select * from xx where 1=2
    这种思想能帮到你吗?
      

  3.   

    select column1,column2 from table1 union all select '','' union all select column1,column2 from table2 
    只能用 union all关键字,可以了,稍候结题
      

  4.   

    也可以:
    select 1 f,column1,column2 from table1 
    union
    select 2,'','' 
    union 
    select 3,column1,column2 from table2 不过,union all效率高一些