sql 一个表 2列做关联, 再次查询后,做连接合并在一行显示
SELECTTOP10[PVNo]as编号1,[UWindoneNo]as编号2,[UWindtwoNo]as编号3,[OutputGoodProduct]as产出,[S...
SELECT TOP 10 [PVNo] as 编号1 ,[UWindoneNo] as 编号2 ,[UWindtwoNo] as 编号3,[OutputGoodProduct] as 产出,[Sampling] as 取样,
[Joint] as 接头 ,[Entrytime] as 时间,[ListNo] as 任务单号,[AdhesiveNO] as 胶水号
FROM [PVMS].[dbo].[Pro_Winding] where UWindoneNo like 'WD%' ORDER by id DESC
SELECT [PVNo] as 编号22 ,[UWindoneNo] as 编号A ,[UWindtwoNo] as 编号4
FROM [PVMS].[dbo].[Pro_Winding] where [PVNo] = 'WD1510200077'
编号1 编号2 编号3 产出 取样 接头 时间 任务单号 胶水号
WD1510220062 WD1510200078 CO1510210036 375.0000 0.0000 0.0000 2015-10-22 15:23:50.603 RWD151016001 333
WD1510220061 WD1510200077 CO1510210036 372.9000 0.0000 1.0000 2015-10-22 15:18:02.647 RWD151016001 333
和
编号22 编号A 编号4
WD1510200077 UW1510200008 CO1510200016
求第一个查询结果和第二个查询结果 合并在一行 展开
[Joint] as 接头 ,[Entrytime] as 时间,[ListNo] as 任务单号,[AdhesiveNO] as 胶水号
FROM [PVMS].[dbo].[Pro_Winding] where UWindoneNo like 'WD%' ORDER by id DESC
SELECT [PVNo] as 编号22 ,[UWindoneNo] as 编号A ,[UWindtwoNo] as 编号4
FROM [PVMS].[dbo].[Pro_Winding] where [PVNo] = 'WD1510200077'
编号1 编号2 编号3 产出 取样 接头 时间 任务单号 胶水号
WD1510220062 WD1510200078 CO1510210036 375.0000 0.0000 0.0000 2015-10-22 15:23:50.603 RWD151016001 333
WD1510220061 WD1510200077 CO1510210036 372.9000 0.0000 1.0000 2015-10-22 15:18:02.647 RWD151016001 333
和
编号22 编号A 编号4
WD1510200077 UW1510200008 CO1510200016
求第一个查询结果和第二个查询结果 合并在一行 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询