方法一:自定义函数
定义Aggregate_BaseMateriel函数
GO
Create FUNCTION Aggregate_BaseMateriel(@ShipMentNo varchar(50))
RETURNS varchar(1024)
AS
BEGIN
declare @Str varchar
情境:
select a.czsj,a.czje,b.jzsj,b.jzje from
(select a.* from table where a.jdbz = "左" and id = 22992)a
full join
(select b.* from table where b.jdbz = "右" and id = 22992)b
on 。。。