SQL union all 问题求助
selectb.INFO_ID,a.INVOICE_DETAIL_ID,c.USER_ID,c.CUSTOMER_NAME,b.ORDER_DATE,b.ORDER_LE...
select
b.INFO_ID , a.INVOICE_DETAIL_ID ,c.USER_ID,
c.CUSTOMER_NAME,
b.ORDER_DATE,b.ORDER_LEVEL,b.INVOICE_AMOUNT,b.TOTAL_AMOUNT,b.ORDER_NO,
a.INVOICE_DETAIL_ID,a.INVOICE_APPLY_ID,a.ORDER_ID,a.ORDER_APPLY_MONEY ,1 as dd
from (INVOICE_APPLY_DETAIL a inner join SALE_ORDER_INFO b
on a. ORDER_ID=b.INFO_ID) inner join customer_info c
on a.ORDER_ID=c.USER_ID
union all
select "","","",
"",
"",ORDER_LEVEL,"","",ORDER_NO,
"","",ORDER_ID,"", 2 as dsjf
from REPAIR_ORDER_INFO
WHERE REPAIR_ORDER_INFO.ORDER_ID
大神帮我看看 哪错了 展开
b.INFO_ID , a.INVOICE_DETAIL_ID ,c.USER_ID,
c.CUSTOMER_NAME,
b.ORDER_DATE,b.ORDER_LEVEL,b.INVOICE_AMOUNT,b.TOTAL_AMOUNT,b.ORDER_NO,
a.INVOICE_DETAIL_ID,a.INVOICE_APPLY_ID,a.ORDER_ID,a.ORDER_APPLY_MONEY ,1 as dd
from (INVOICE_APPLY_DETAIL a inner join SALE_ORDER_INFO b
on a. ORDER_ID=b.INFO_ID) inner join customer_info c
on a.ORDER_ID=c.USER_ID
union all
select "","","",
"",
"",ORDER_LEVEL,"","",ORDER_NO,
"","",ORDER_ID,"", 2 as dsjf
from REPAIR_ORDER_INFO
WHERE REPAIR_ORDER_INFO.ORDER_ID
大神帮我看看 哪错了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询