Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Stuff
CREATE TABLE vw_DemandForceFull (def_vehicleID INT, def_ADSService varchar(1)); INSERT INTO vw_DemandForceFull VALUES (1,'A'); INSERT INTO vw_DemandForceFull VALUES (1,'B'); INSERT INTO vw_DemandForceFull VALUES (1,'C'); INSERT INTO vw_DemandForceFull VALUES (1,'E'); INSERT INTO vw_DemandForceFull (def_vehicleID) VALUES (2); Select DISTINCT def_vehicleID, STUFF((Select '|' + def_ADSService from vw_DemandForceFull t2 where t1.def_vehicleID = t2.def_vehicleID FOR XML PATH(''), TYPE ).value('.','NVARCHAR(MAX)'),1,1,'') From vw_demandForceFull t1 STUFF((SELECT '|' + (def_ADSService) from vw_DemandForceDeferFull t2 where t1.cust_CustID = t2.cust_CustID and t1.cust_Company = t2.cust_Company and t1.veh_ID = t2.veh_ID and t1.def_ID = t2.def_ID FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)'),1,1,'') --^^ IS this the <length> parameter for the stuff Function? It's tough to follow with how much you have going on in this statement'
run
|
edit
|
history
|
help
0
20181cse0065
Tarea1
Using pre-built schema in sql server
months
Loan
trigger
Common Table Expression
Sequence object -- New Feature of 2012 sql server
Database ownership
Tbl