i have a query like this :
Select ','''+ aa.KodeVerifikasi +''''
From TVerifikasiPOFakturHeader as aa (NOLOCK)
inner join TVerifikasiPOFakturDetail as bb (NOLOCK) on aa.KodeVerifikasi=bb.KodeVerifikasi
Where aa.KodePO='TS/01/15/00183'
group by aa.KodeVerifikasi
order by aa.KodeVerifikasi
For XML PATH ('')
and i get the return like this :
,'val6','val4','val5','val9'
but i want to remove first character "," and i want to get return like this :
'val6','val4','val5','val9'
when i using substring : SUBSTRING(','''+ aa.KodeVerifikasi +'''', 2, 8000) i get return like this : 'val6''val4''val5''val9'
please help me,,, and thanks...
USE STUFF
SELECT STUFF((
your query here
),1,1,'')
Try this
select STUFF( (Select ','''+ aa.KodeVerifikasi +''''
From TVerifikasiPOFakturHeader as aa (NOLOCK)
inner join TVerifikasiPOFakturDetail as bb (NOLOCK)
on aa.KodeVerifikasi=bb.KodeVerifikasi
Where aa.KodePO='TS/01/15/00183'
group by aa.KodeVerifikasi
order by aa.KodeVerifikasi
For XML PATH ('') ),1,1,'')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With