Ini terlihat seperti solusi yang gila, tetapi Anda dapat mencapainya menggunakan fungsi berjendela ROW_NUMBER()
dan menggunakan CASE
ekspresi periksa apakah nomor baris lebih tinggi dari 1, seperti:
select
[Vch No.],
[Vch Type],
case when rn > 1 then '' else [Vch Ref] end as [Vch Ref],
case when rn > 1 then '' else [Date] end as [Date],
case when rn > 1 then '' else [Party Name] end as [Party Name],
case when rn > 1 then '' else [Sales Ledger] end as [Sales Ledger],
case when rn > 1 then '' else [Amt] end as [Amt],
[GST Ledger],
[TaxAmount],
case when rn > 1 then '' else [Total] end as [Total]
from (
select
[Vch No.],
[Vch Type],
[Vch Ref],
[Date],
[Party Name],
[Sales Ledger],
[Amt],
[GST Ledger],
[TaxAmount],
[Total],
row_number() over (partition by [Vch No.],[Vch Type],[Vch Ref],[Date],[Party Name],[Sales Ledger],[Amt],[GST Ledger],[TaxAmount],[Total] order by [Vch No.]) rn
from [AccountData]
)x
Lihat tipe data, jika ada Amt
adalah INT Anda harus mengubahnya menjadi string jika Anda ingin mendapatkan nilai kosong.